Microsoft – SQL Server – Lists Schema Bound Objects



--List Schema Bound Objects

SELECT 

         Schema_name(tab.schema_id) AS [schema],

         Object_name(dep.id) AS objectname,

         tab.type_desc AS objecttype

FROM sys.sysdepends dep

            INNER JOIN sys.columns col

                ON dep.depid = col.object_id

                AND dep.depnumber = col.column_id

            INNER JOIN sys.objects tab

                ON dep.id = tab.object_id

WHERE dep.deptype = 1

GROUP BY 
               tab.schema_id

             , dep.id,

             , tab.type_desc

ORDER BY 
               Schema_name(tab.schema_id)

             , Object_name(dep.id)

 

 

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com 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