Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Odd behaviour from sys.dependencies


Odd behaviour from sys.dependencies

Author
Message
Lynn Pettis
Lynn Pettis
SSC-Insane
SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)

Group: General Forum Members
Points: 24168 Visits: 37932
Have you checked the error logs to see if anything is going on elsewhere with SQL or Windows?

Cool
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)
JJB@TGT
JJB@TGT
Grasshopper
Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)

Group: General Forum Members
Points: 11 Visits: 51
No, nothing untoward in logs...
bitumenpit
bitumenpit
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
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
T4FF
T4FF
Grasshopper
Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)

Group: General Forum Members
Points: 12 Visits: 182
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??
bitumenpit
bitumenpit
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search