• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 203
  • Last Modified:

Text find in sql server 2005

Hi,

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

Thanks in Advance
0
ksd123
Asked:
ksd123
1 Solution
 
momi_sabagCommented:
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
0
 
TempDBACommented:
you can use syscomments as well.
0
 
sarabhaiCommented:
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 .
0
 
Éric MoreauSenior .Net ConsultantCommented:
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now