Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Trace Flag Forcing All Dependancies to exist at Proc Creation? Expand / Collapse
Author
Message
Posted Wednesday, August 29, 2012 6:06 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 7:35 AM
Points: 12,889, Visits: 31,844
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

--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #1351542
Posted Wednesday, August 29, 2012 8:06 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 8:03 AM
Points: 13,128, Visits: 11,966

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 Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Post #1351641
Posted Wednesday, August 29, 2012 10:43 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 8:33 AM
Points: 1,875, Visits: 3,004
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
Post #1351762
Posted Wednesday, August 29, 2012 12:38 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 8:47 AM
Points: 42,479, Visits: 35,547
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 2008, MVP
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

Post #1351836
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse