Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to locate a phrase in all sp of a database

Author  Topic 

AdamWest
Constraint Violating Yak Guru

360 Posts

Posted - 2012-09-27 : 09:35:54
HI I have this phrase "@FACILITYKEY CHAR(4)" which i need to modify in any sp it is located in.

HOw can I get a list of such sp's?

Much thanks in advance,
Adam

robvolk
Most Valuable Yak

15732 Posts

Posted - 2012-09-27 : 09:42:53
SELECT name FROM sys.objects WHERE OBJECT_DEFINITION(object_id) LIKE '%@FACILITYKEY CHAR(4)%'
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2012-09-27 : 09:43:57
more ideas
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=100884


Too old to Rock'n'Roll too young to die.
Go to Top of Page

AdamWest
Constraint Violating Yak Guru

360 Posts

Posted - 2012-09-27 : 09:44:53
Very nice Rob, thanks. Just was wondering, suppose i am only interested in my sp's which all start with a DBD as in
DBD_MySP1.


quote:
Originally posted by robvolk

SELECT name FROM sys.objects WHERE OBJECT_DEFINITION(object_id) LIKE '%@FACILITYKEY CHAR(4)%'

Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2012-09-27 : 09:49:35
SELECT name FROM sys.objects WHERE name LIKE 'DBD%' AND OBJECT_DEFINITION(object_id) LIKE '%@FACILITYKEY CHAR(4)%'
Go to Top of Page
   

- Advertisement -