August 17, 2011 at 2:23 pm
I am looking to see if anyone has a way to search database objects for certain text. If "ServerA" is in the guts of a SPROC and/or FUNCTION, I would like to know which ones.
As always thanks for the Help...
August 17, 2011 at 3:00 pm
Have a look at the sys.sql_modules(http://msdn.microsoft.com/en-us/library/ms175081.aspx) system view. The definition column should have the data you are looking for.
August 17, 2011 at 3:09 pm
Thanks Bob, that works. If anyone else has a different way to do this, I would like to see it.
August 17, 2011 at 4:02 pm
This finds a string in functions, views, and stored procedures.
select distinct o.name, o.type_desc from sys.objects o
where OBJECT_DEFINITION(o.object_id) like '%searchstring%'
order by o.name
Greg
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply