Execute the second SP and store the values to
a table variable or temp table.
Now your job is easy that all you have to do is
SELECT * FROM tblItem WHERE itemID IN (Select id from temptable)
Or better do an INNER JOIN with the temp table.
Roji. P. Thomas
SQL Server Programmer ;)
"Gerald" <gege107hotmail.com> wrote in message
> I'm trying to select fileds that are in the results of a SP.
> So I have the table "tblItem"
> itemID int Identity Key,
> itemName varchar (100),
> itemDate smalldatetime
> I have a SP "p_getItemID"
> which is lets say
> SELECT TOP 10 itemID FROM tblItem
> Now what I want to do is:
> SELECT * FROM tblItem WHERE itemID IN (EXEC p_getItemID)
> I want to select from the table but only the itemId's returned by the sp.
> Can you do that?