dm_sql_referenced_entities and aliases

sys.dm_sql_referenced_entities is a system function of Microsoft SQL Server that allows to get dependencies which an object has. E.g. you can find out what tables and store procedures are used within a body of a stored procedure named ‘’ you are inspecting:

SELECT * FROM sys.dm_sql_referenced_entities('', 'OBJECT')

Unfortunately there is a bug in builds before SQL Server 2008 July CTP inclusively. The nature of bug is if the ‘’ stored procedure contains UPDATE or DELETE statements with aliases they are not resolved.

See more @ connect

This entry was posted in Microsoft SQL Server. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s