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.
Author |
Topic |
Mckay
Starting Member
8 Posts |
Posted - 2005-11-25 : 22:38:53
|
hi,is there any function to search a string in every trigger and stored procedure?ThanksRegardsMcKay |
|
Kristen
Test
22859 Posts |
Posted - 2005-11-26 : 05:11:21
|
[code]SELECT DISTINCT O.xtype, O.[name]FROM dbo.syscomments AS C JOIN dbo.sysobjects AS O ON O.id = C.idWHERE [text] LIKE '%MySearchPhrase%'ORDER BY O.xtype, O.[name][/code]Use xtype in the WHERE clause to constrain by type, if required (this will include Views, Functions, etc.). ENCRYPTED objects will NOT be searchedKristen |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-11-28 : 00:50:04
|
alsoselect routine_definition from information_schema.routineswhere routine_definition like '%searchString%'and note that this will exclude triggers if anyMadhivananFailing to plan is Planning to fail |
|
|
Mckay
Starting Member
8 Posts |
Posted - 2005-11-28 : 03:55:24
|
hmm, if i don't make mistake... i have ever use a system stored procedure in sql 7 to search a string ... but i forgot the stored procedure name.....? |
|
|
|
|
|