Thursday, 15 April 2010

sql server - Is there a method to list all objects such as VIEWs that use a SYNONYM? -



sql server - Is there a method to list all objects such as VIEWs that use a SYNONYM? -

like says on tin. how can determine sql objects using given synonym? suppose 1 way search contents of proc or view , run like '%syn_name%' seems kludgy.

select * sys.sql_expression_dependencies referenced_id = object_id('<syn schema>.<syn name>')

this view gives access tree of dependencies. if want objects reference objects returns, need recurse or similar.

you can restrict views bring together sys.objects or objectproperty()

sql-server sql-server-2008

No comments:

Post a Comment