Find a stored procedure containing a text
Tuesday 10, February 2015 | Post link
Here is an easy way to find stored procedures containing a particular string. In the example, I am looking for stored procedures containing the string "logging".
OBJECT_DEFINITION function works not just for stored procedures but also for check constraints, default constraints, scalar functions, rules, triggers, table values functions and views.
select p.name, OBJECT_DEFINITION (p.object_id) from sys.procedures p where OBJECT_DEFINITION (object_id) LIKE '%logging%'
OBJECT_DEFINITION function works not just for stored procedures but also for check constraints, default constraints, scalar functions, rules, triggers, table values functions and views.
Categories:
Programming (28)
TSQL (5)
Tags:
SQL(2)
Comments