Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need SP to check multiple parts of database and return results.

Status
Not open for further replies.

ironhide1975

Programmer
Feb 25, 2003
451
US
I need an example of a stored procedure that can check several tables in a database and return a result of where a string may be found.

For example, say I want to pass the word 'dog' to the SP. It then checks to see if Dog is in a field of Table1.field1 and Table2.field1. If it finds it in any record with this, it just returns a 'Found in Table 1' or 'Found in Table 2' result.

Any help is greatily appreciated.

 
do you want a dynamic sproc which can take in potentially any table/column in the database or do you need it to look in a static set of tables/columns?

if 1, then I'd try to generate some dynamic sql, if 2, then just hard code in a set of select statements...

--------------------
Procrastinate Now!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top