Trace Flag Forcing All Dependancies to exist at Proc Creation?

  • OK I'm in a discussion with a coworker related to dependancies.

    you know you can create a procedure that used defered resolution , so it can be created without the object (like a table, for example) having to exist at Proc Creation time.

    this can result, obviously, in dependancies being inaccurate if you look through any of the dmv's:

    sys.sql_dependencies

    sys.sql_expression_dependencies

    sys.dm_sql_referenced_entities

    sys.dm_sql_referencing_entities

    my coworker insists there is a way via a startup flag to turn off this feature, and force all objects to exist when a procedure is created in order to prevent missing dependancies;

    When i produced a list of trace flags from microsoft, he said it's an unsupported flag, but doesn't know the number.

    I insist there is no such functionality. to fix depednancies, I've always recompiled all objects, and checked for invalid objects afterwards.

    Anyone ever heard of this magic trace flag?

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • he said it's an unsupported flag, but doesn't know the number.

    Sounds to me like a lot of smoke blowing is going on there. 😛

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • It's an active MS Connect issue (from SQL 2005 no less!), so I guess it's not an option...

    http://connect.microsoft.com/SQL/feedback/ViewFeedback.aspx?FeedbackID=127152

  • Never heard of such a trace flag. If one did exist that turned off deferred name resolution, it would spectacularly break procedures that create and use temp tables.

    sys.dm_sql_referenced_entities

    sys.dm_sql_referencing_entities

    These should be OK even with deferred name resolution. They were created in SQL 2008 because of that problem.

    From BoL:

    Unlike earlier versions of SQL Server, in which dependencies were tracked by ID, dependencies are now tracked by name. This means that the Database Engine tracks dependency information between two entities even if the referenced entity does not exist at the time the referencing entity is created. This circumstance can occur because of deferred name resolution. For example, a stored procedure that references a table can be successfully created, but not executed, even if the referenced table does not exist in the database. The Database Engine records the dependency between the procedure and table, however, an ID for the table cannot be recorded because the object does not yet exist. If the table is later created, the ID of the table is returned with the other dependency information.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply