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!

Don't return multiple Select's

Status
Not open for further replies.

RobS23

Programmer
Jun 4, 2001
161
GB
How do I stop returning multiple resultsets?

I need to use selects to populate some parameters

Select @Brand = brand from BTable -- Don't return this

and then I want to return the single resultset

Select Name from NameTable Where name = @Brand -- Just return this

Cheers Folks
 
post your entire statement or procedure that you're using...need a little more information...

you can do this to set a variable...
Code:
Set @Brand = (select brand from BTable)
dlc
 
Try a Sub SELECT:

Code:
SELECT [Name]
FROM NameTable
WHERE [Name] IN (SELECT Brand FROM BTable)

-SQLBill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top