Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Find a string in DB objects.

By James Travis,

Find a string in Procedures, Triggers, Constraints, Defaults, Functions, and Views. First off this will not work for any items that have the WITH ENCRYPTION remark in them. With this is can pose a string such as 'INSERT' against all the 'P'rocedures to get a return of which Procedures have an INSERT statment in them or you can do word strings such as 'FROM TABLE1 WHERE COL1 =' or string list searches such as 'INSERT%TABLE1%COL1 ='. You can use any valid like strings you wish, but you don't need leading and ending wildcards as general most items start with a specific item such as CREATE which will be contained in the majority of code items. This is compatible with SQL 7/2000.

Total article views: 1623 | Views in the last 30 days: 6
 
Related Articles
BLOG

Inserting Markup into a String with SQL

 There are a number of occasions when one might want to insert information at various places in a st...

FORUM

string Comparison.

'string' = 'string___' ???

BLOG

T-SQL: Identifying, inserting and removing spaces in strings

Frequently, when working with strings you will need to identify, insert or remove spaces before, aft...

FORUM

Help needed to decode comma delimited string and insert into tables

Help needed to decode comma delimited string and insert into tables

FORUM

csv string

csv string

Tags
 
Contribute