Showing posts with label Filter. Show all posts
Showing posts with label Filter. Show all posts

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 + '%'


Filter or Search SQL Stored Procedure using SQL Query

In this post, I will explain how to filter Stored Procedure with containing text in the SQL Server database using SQL Query.  

To filter all stored procedures which contain given text in SQL server we need to write a query using SYS.PROCEDURES table.


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

SELECT * FROM SYS.PROCEDURES          
WHERE NAME LIKE '%'+ @PARAMETER +'%'          
ORDER BY MODIFY_DATE DESC  



Filter or Search SQL View using SQL Query

In this article, I will explain how to filter view with containing text in the SQL server database using SQL query.  

To filter all views which contain given text in SQL server we need to write a query using SYS.VIEWS table.


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

SELECT * FROM SYS.VIEWS            
WHERE NAME LIKE '%'+ @PARAMETER +'%'  
ORDER BY MODIFY_DATE    DESC 



Filter or Search SQL table using SQL Query

In this article, I will explain how to filter table with containing text in SQL server database using SQL query.  

To filter all table which contains given text in SQL server we need to write query using SYS.TABLES table.

SQL Query :

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

SELECT * FROM SYS.TABLES      
WHERE NAME LIKE '%'+ @PARAMETER +'%'      
ORDER BY MODIFY_DATE DESC