The Problem – Find A Specific Database Value
I’m writing a custom SQL report and need to find where a field is stored in the database or I’m looking for a specific column, however, I cannot recall when table the column resides. In the past, I’ve used various stored procedures to search an entire database for a value. This would take hours for a large database and put an unnecessary load on the SQL Server.
The Solution – Seach The Entire Database
I found this free tool ApexSQL Search by Quest. In addition to searching for a value in the database, you can also search for objects in the entire database schema. For example, you know the word “total_amount” appears in a trigger or in a stored procedure, searching the database objects will display all objects that contain “total_amount”. ApexSQL installs directly into SQL Server Management Studio.
Use case: There is a value on the front-end website, but you are not sure where in the database that value is stored. You need to search the entire database for the value.
Example: “Flat Amount” on the tenant screen, and you want to see which table/column stores that value.
Using ApexSQL Search you can easily find the value.
After installing ApexSQL, click on “ApexSQL >> ApexSQL Search >> Text Search” from the menu bar.
You’ll see the window below displayed. Enter in your search term, check or uncheck the column data types you want to search. Finally, click on “Find”.
In the results pane, you’ll see the table name, schema, database name, and column value.
To download ApexSQL, click on the image below.