question

GPO avatar image
GPO asked

DMV to search through synonym DDL

Is there a DMV or something similar that will allow me to search for a particular string in the DDL of a synonym? For example if I created a synonym as follows: CREATE SYNONYM [my_schema].[my_synonym] FOR [other_server].[other_db].[other_schema].[other_view_about_business_stuff] ...how can I search through all my synonyms for the string 'business_stuff'? Oh... and I'd want it to be able to work on SQL 2005 or later.
ddldmvsearchsynonyms
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Sacred Jewel avatar image
Sacred Jewel answered
Its not a DMV but an object catalog view what you need... SELECT * FROM sys.synonyms WHERE base_object_name LIKE '%business_stuff%'
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

GPO avatar image GPO commented ·
That's tremendous. Many thanks.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.