开发者

How to search for a string in multiple Stored Procedure Queries

I am trying to figure out how specific table is loaded in Microsoft SQL Server Management Studio. Is there a way to search through all the Stored Procedure queries? I can chose to modify each one and search through the query but there are too many to manually search in that fashion. Any advice in relation to searching for strings in SQL Server Management Studio would be much appreciated.开发者_Go百科 thanks


SELECT OBJECT_NAME(M.object_id), M.*
FROM sys.sql_modules M
JOIN sys.procedures P
ON M.object_id = P.object_id
WHERE M.definition LIKE '%YourTable%'


Have a look at the FREE Red-Gate tool called SQL Search which does this - it searches your entire database for any kind of string(s).

How to search for a string in multiple Stored Procedure Queries

How to search for a string in multiple Stored Procedure Queries

It's a great must-have tool for any DBA or database developer - did I already mention it's absolutely FREE to use for any kind of use??


From here, I found the following snippet to search through the stored procs:

exec sp_stored_procedures 'a%'
OR
exec sp_stored_procedures @sp_name = 'a%'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜