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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Search in DB objects as well as table data

Author  Topic 

companionz
Yak Posting Veteran

54 Posts

Posted - 2009-04-15 : 09:50:06
Hi Guys!

I've to find 'xxx@xx.com' either hardcoded in any database object like procedure and also look in entire table data in the database for this string.

HOw to go about it?

Thanks for help

Sourav

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-04-15 : 09:53:27
For procedures

select * from sys.sql_modules where definition like '%xxx@xx.com%'



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-04-15 : 14:02:23
for searching tables have a look at this

http://vyaskn.tripod.com/search_all_columns_in_all_tables.htm
Go to Top of Page

kunal.mehta
Yak Posting Veteran

83 Posts

Posted - 2009-04-16 : 04:11:10
Hi,

for db objects

select * from syscomments where text like '%searchstring%

Kunal

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-04-16 : 11:07:12
its better to use sys.sql_modules as syscomments might span the content across multiple rows when content goes beyond 4000 chars.Also the view syscomments is included only for backward compatibility
Go to Top of Page
   

- Advertisement -