Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Mutliple Table Search

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-03-08 : 10:15:47
Luis writes "I am trying to design an ASP page that allows the user to input one parameter to search on but gets results from multiple tables.

Example: Search for Smith on Hourly Employee table, Management table & Contractor Table"

yakoo
Constraint Violating Yak Guru

312 Posts

Posted - 2002-03-08 : 10:43:35
depends what values you want to return.

If the values would be the same type from each table, such as id (int) table (varchar) and desc (varchar) then use the UNION statement in SQL. do a search in BOL for more details

Go to Top of Page

setbasedisthetruepath
Used SQL Salesman

992 Posts

Posted - 2002-03-08 : 11:27:36
I would expand on yakoo's suggestion of the union approach by wrapping such a select statement within a view. It's advantageous in terms of flexibility, maintenance, etc.

Go to Top of Page
   

- Advertisement -