Useful SQL script for searching the text across the database

Justin Cooney

There are times when it comes in handy to be able to query all columns of all of the tables in a database for a particular text match. For example: if you have just taken over a project with a large database and are trying to find where values from the UI are coming from, then it helps to be able to match text from the UI with tables and columns.

So you can see how being able to use a T-SQL query to locate the table and column responsible for holding specific data saves a lot of time. Rather than searching through the database diagram and guessing at tables and columns, you can simply run a blanket search to find out where the columns you need are.

In this article I’m providing a fully working example of a query that will search your database for any specific text that…

View original post 407 more words

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s