Hi JJ,
I have two comments to your issue.
1 - I had to look up this dm on books on line since I never used it. The sample from BOL works fine.
USE AdventureWorks2012;
GO
SELECT referenced_schema_name, referenced_entity_name, referenced_minor_name,
referenced_minor_id, referenced_class_desc, is_caller_dependent, is_ambiguous, referenced_minor_name
FROM sys.dm_sql_referenced_entities ('dbo.ufnGetContactInformation', 'OBJECT');
GO
If I take your code and replace the object name with the BOL sample, it does not work.
-- This is due to the fact the code does not handle a name that does not have a underscore, second sub string calculation. Some defensive programming will make the solution portable.
2 - Taking a quick look at your post, it looks like that field is in another collation sequence / code page.
-- Check the code page on the database.
3 - From BOL, the field is defined as the following.
Column name when the referenced entity is a column; otherwise NULL. For example, referenced_minor_name is NULL in the row that lists the referenced entity itself.
A referenced entity is a column when a column is identified by name in the referencing entity, or when the parent entity is used in a SELECT * statement.
-- I would do a DBCC on the database to make sure there are not system issues with the database.
Thanks again for your post, I always learn something from replying to them.
Tell me how you make out.
Sincerely
John
John Miner
Crafty DBA
www.craftydba.com