Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
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 text string in any column in a database

By Kenneth Fisher,

This script is great if you are asked to find every occurance of a string in your database. Set the @Search_For variable to the string you are looking for then run the script and you will get back a table listing every table/column that contains that value.

This is particularly useful when having to make sure you remove all references of a string from your database or if you don't know the structure as well as you might like and need to find some information.

WARNING: This script can take a long time on a large database.

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

search and replace a string in all user tables’ data in all databases

This script will search for the input string in all the tables(data) from all the databases and will...


Generate script to change column length of string datatypes in a DB

This script can be used to generate alter column length of any string data type column(s) in a datab...


Scripting Remote Database using SMO in .net

Can't script remote database using script method


I need script related to databases

glnp scripts on database


Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones