Find UDT given spnames


Find UDT given spnames

coalesce(object_schema_name(Referencing_ID)+’.’,”)+ –likely schema name
object_name(Referencing_ID)+ –definite entity name
AS [referencing],
coalesce(Referenced_server_name+’.’,”)+ –possible server name if cross-server
coalesce(referenced_database_name+’.’,”)+ –possible database name if cross-database
coalesce(referenced_schema_name+’.’,”)+ –likely schema name
coalesce(referenced_entity_name,”) + –very likely entity name
coalesce(‘.’+col_name(referenced_ID,referenced_minor_id),”)AS [referenced],*
FROM sys.sql_expression_dependencies d
INNER JOIN sys.objects O ON d.referencing_id=O.object_id
and referenced_entity_name LIKE ‘UDT%’
ORDER BY [referenced]

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s