Search
 
SCRIPT & CODE EXAMPLE
 

SQL

Find sp name by text in sql server

SELECT ROUTINE_NAME, ROUTINE_DEFINITION
    FROM INFORMATION_SCHEMA.ROUTINES 
    WHERE ROUTINE_DEFINITION LIKE '%Foo%' 
    AND ROUTINE_TYPE='PROCEDURE'
    
SELECT OBJECT_NAME(id) 
    FROM SYSCOMMENTS 
    WHERE [text] LIKE '%Foo%' 
    AND OBJECTPROPERTY(id, 'IsProcedure') = 1 
    GROUP BY OBJECT_NAME(id)
    
SELECT OBJECT_NAME(object_id)
    FROM sys.sql_modules
    WHERE OBJECTPROPERTY(object_id, 'IsProcedure') = 1
    AND definition LIKE '%Foo%'    
Comment

SQL find text in SP

SELECT DISTINCT
       o.name AS Object_Name,
       o.type_desc
FROM sys.sql_modules m
       INNER JOIN
       sys.objects o
         ON m.object_id = o.object_id
WHERE m.definition Like '%[ABD]%';
Comment

SQL Find text in SPs

SELECT OBJECT_NAME(id) 
    FROM SYSCOMMENTS 
    WHERE [text] LIKE '%Foo%' 
    AND OBJECTPROPERTY(id, 'IsProcedure') = 1 
    GROUP BY OBJECT_NAME(id)
Comment

PREVIOUS NEXT
Code Example
Sql :: sql insert into statement 
Sql :: replace content value from old to new sql 
Sql :: sql default constraint 
Sql :: fk in insert mysql 
Sql :: Drop check constraint in ms sql 
Sql :: flask-sqlalchemy filter_by contains 
Sql :: json to dynamic columns in sql 
Sql :: how to update sql server version 
Sql :: sql left join with where clause 
Sql :: sql limit order by 
Sql :: postgresql variable in query 
Sql :: insert data from one database table to another database table in postgresql using pgadmin 
Sql :: sql select data type of query 
Sql :: sql create cluster index 
Sql :: insert multiple rows from another table sql 
Sql :: t-sql never ending delete 
Sql :: oracle last connection 
Sql :: openquery join two tables 
Sql :: mysql get 2nd value in comma separated list 
Sql :: oracle sql all days except weekends 
Sql :: tsql generate rows 
Sql :: mysql show column type 
Sql :: creating tables in sql with python 
Sql :: dump db only triggers mysql 
Sql :: mysql having 
Sql :: import sql file to mysql db using shell commands 
Sql :: copy data from one database to another 
Sql :: description query in sql 
Sql :: how to select only a certain date sql 
Sql :: google sheets filter rows above current cell 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =