Contents
How do I search for text in all stored procedures in SQL Server?
Search text in stored procedure in SQL Server
- 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]%’;
How do you find the stored procedures using a table?
Using below mentioned important T-SQL query, we can get the list of the tables used in the stored procedure.
- SELECT.
- NAME as ‘List Of Tables’
- FROM SYSOBJECTS.
- WHERE ID IN ( SELECT SD.DEPID.
- FROM SYSOBJECTS SO,
- SYSDEPENDS SD.
- WHERE SO. NAME = ‘Sp_ListTables’ —-name of stored procedures.
- AND SD.ID = SO.ID.
How to search for text in stored procedure in SQL?
I want to search for a text from all my database stored procedures. I use the below SQL: I want to search for [ABD] in all stored procedures including square brackets, but it’s not giving the proper result.
How to search for Abd in stored procedure?
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]%’; I want to search for [ABD] in all stored procedures including square brackets, but it’s not giving the proper result.
How to search for procedures and functions in Oracle?
To do this in Oracle, one would query the Data Dictionary ALL_SOURCE (or DBA_SOURCE, depending on permissions) like so: This is generally a quick and dirty way to search all procedures, packages, and functions for something like a custom error string or calls to other procedures (which can also be done with ALL_DEPENDENCIES)
How are stored procedures and functions stored in MySQL?
MySQL stores routines a bit differently than Oracle, but this is still possible. Since MySQL does not have dependency tracking functionality, if one makes a change to a stored function and wants to find all other stored procedures that call that function, one would query the PROC table in the MYSQL database like so: