Find Specified Value Script | Database Journal

Find Specified Value Script

Dec 8, 2001
1 minute read

Here’s a script that will find a value in a field. The stored procedure will go through each field in each table of a database and look for a specified value (for example, order number ‘1-ASD-DER-45T’ or similar). The value you are looking for and the data type (varchar, int, etc.) need to be supplied as parameters. The script will then give you the table name, column name, and matching values from the entire database. This stored procedure will work in SQL Server 7.0 and SQL Server 2000.

There are two text files in the ZIP package — sp_check_field_all_db.txt is the stored procedure itself, while find_anything_in_db_by_value is an example of how to use the sp.

Author: Roman Feldblum

Download Script:
sp_findvalue.zip



Disclaimer:
We hope that the information on these script pages is
valuable to you. Your use of the information contained in these pages,
however, is at your sole risk. All information on these pages is provided
“as -is”, without any warranty, whether express or implied, of its accuracy,
completeness, or fitness for a particular purpose…

Disclaimer Continued

Back to Database Journal Home

Database Journal Logo

DatabaseJournal.com publishes relevant, up-to-date and pragmatic articles on the use of database hardware and management tools and serves as a forum for professional knowledge about proprietary, open source and cloud-based databases--foundational technology for all IT systems. We publish insightful articles about new products, best practices and trends; readers help each other out on various database questions and problems. Database management systems (DBMS) and database security processes are also key areas of focus at DatabaseJournal.com.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.