We help IT Professionals succeed at work.

Text find in sql server 2005

ksd123
ksd123 asked
on
Hi,

I would like to find a specific string  in all tables,stored procedures,triggers within same database.

Thanks in Advance
Comment
Watch Question

what do you mean by find a string in the stored procedure? in the actual source code?
try to look at this table
sys.sql_modules

as for checking all the columns of all the tables, you will have to create a script that does it by querying information _schema.columns and assemble the proper sql statements

Commented:
you can use syscomments as well.
sarabhaiDeveloper
CERTIFIED EXPERT

Commented:
SELECT sm.object_id, OBJECT_NAME(sm.object_id) AS object_name, o.type,
    o.type_desc, sm.definition
FROM sys.sql_modules AS sm
JOIN sys.objects AS o ON sm.object_id = o.object_id
where sm.definition like '%search_Criteria%'

this is not run for the object created with ENCRYPTION .
Éric MoreauSenior .Net Consultant
CERTIFIED EXPERT
Top Expert 2016

Commented:

Explore More ContentExplore courses, solutions, and other research materials related to this topic.