Ad Code

How to find String in All Stored Procedures in SQL Server Database

How to find String in All Stored Procedures in SQL Server Database

We frequently get into scenarios when we need to search for a string across all of a database's stored processes. Below is a list of a few of them.

         Determine the number of stored procedures that use cross-database queries by conducting a database name search across all stored procedures in a database.

        Discover how many stored procedures in a database use a particular table or view? This may occur when we wish to see if any stored procedures will be impacted by our plans to rename a table or view.

        Determine the name of the column(s) utilised in the SQL Server database's stored procedures.

        If the Creator name is mentioned in the comments, look for some remarks in each Stored Procedure to identify who produced those Stored Procedures.

There might be other circumstances. The system tables and views that SQL Server offers us hold data and object definitions so we may access information about objects like tables, views, stored procedures, triggers, and functions, among others.



SELECT OBJECT_NAME(OBJECT_ID) AS ObjectName,
      

 definition             AS ObjectDefinition

 FROM   sys.sql_modules 

WHERE  definition LIKE '%Creator Name=Anishur%'


 SELECT OBJECT_NAME(id) AS ObjectName,

       TEXT AS ObjectDefinition 

FROM   sys.syscomments 

WHERE  TEXT LIKE '%Creator Name=Anishur%' 

 

 

 

Post a Comment

0 Comments

Close Menu