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 ««12

Odd behaviour from sys.dependencies Expand / Collapse
Author
Message
Posted Friday, April 12, 2013 9:26 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 12:53 PM
Points: 22,992, Visits: 31,467
Have you checked the error logs to see if anything is going on elsewhere with SQL or Windows?



Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #1441769
Posted Saturday, April 13, 2013 12:46 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, September 9, 2013 3:02 AM
Points: 11, Visits: 41
No, nothing untoward in logs...
Post #1442014
Posted Thursday, March 6, 2014 10:22 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, March 7, 2014 9:31 AM
Points: 2, Visits: 11
The only way I have found to defeat this bug is to do an inner join to sys.columns, on referenced_minor_id directly, because it does not get garbled even when the referenced_minor_name does.

SELECT Distinct
refc.referenced_schema_name, refc.referenced_entity_name,
col.column_id AS column_number,
lower(isnull(col.name,'')) AS column_name,
lower(refc.referenced_minor_name) AS bad_data

FROM sys.dm_sql_referenced_entities
(<schema>+'.'+<object_name>,'OBJECT') refc

INNER JOIN sys.columns col
ON ( col.[object_id] = refc.referenced_id )
AND ( col.column_id = refc.referenced_minor_id )

ORDER BY
refc.referenced_entity_name,
column_number
Post #1548381
Posted Thursday, March 6, 2014 12:21 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Sunday, June 22, 2014 8:35 PM
Points: 12, Visits: 153
bitumenpit (3/6/2014)
The only way I have found to defeat this bug is to do an inner join to sys.columns, on referenced_minor_id directly, because it does not get garbled even when the referenced_minor_name does.


Are you suggesting you've seen the same behaviour??
Post #1548430
Posted Thursday, March 6, 2014 1:48 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, March 7, 2014 9:31 AM
Points: 2, Visits: 11
Yes, constantly - each result is different, and therefore the lot of them are unreliable when executing a batch of them in a WHILE loop.

Joining to sys.columns and directly using {col.column_id = refc.referenced_minor_id} is one way to be certain that you've got them all, as referenced_minor_id is not subject to mangling.
Post #1548472
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse