Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

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

Search All Columns in All Tables for a string

By tcartwright,

This procedure can search all columns in one or all tables for a specified string. Prints out the TableName.ColumnName that the string is found in...

--     Example Calls
--     EXECUTE spFindTextInColumns MyTable, 'tcart' --search a specific table
--        
--     EXECUTE spFindTextInColumns default, 'tcart' --search all tables BUG FIX : (2003/01/20) Changed SELECT @columnName = [COLUMN_NAME], to: SELECT @columnName = '[' + [COLUMN_NAME] ']', to avoid: Line 1: Incorrect syntax near '~' Thanks to Avraham de-Haan for pointing this one out.

Total article views: 683 | Views in the last 30 days: 1
 
Related Articles
SCRIPT

Searching Column Name in All Tables

Use this script to search for a specific column name in all tables in a current database.

SCRIPT

String Search

Search for a string value within columns of data types CHAR, NCHAR, NTEXT, NVARCHAR, TEXT, VARCHAR, ...

SCRIPT

Object Search

Procedure to search any database (or a combination of databases, including all) for a specific strin...

FORUM

How to encrypt column data which is configured for full text search?

Any ZIP file IFilter which will do encrypt/decrypt on full text search column?

SCRIPT

Search for a Column in all databases

This Script can be used for searching a column in SQL server 2005

Tags
miscellaneous    
t-sql    
 
Contribute

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
Editor, SQLServerCentral.com

Already a member? Jump in:

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