Wednesday 8 March 2017

Find Stored Procedures & Views Containing Text

In this post, I will explain how to find Stored Procedures & Views with containing text in SQL server database using SQL query.

To find Stored Procedures & Views which contains given text in SQL server we need to write a query using SYS.SQL_MODULES.


DECLARE @Parameter VARCHAR(100)   
SET @Parameter = 'employee'

SELECT * 
FROM SYS.SQL_MODULES

WHERE DEFINITION LIKE '%' + @Parameter + '%'


0 comments:

Post a Comment

Please do not enter any spam link in the message box.