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 2005 Forums
 Other SQL Server Topics (2005)
 Returning multiple values from a stored procedure.

Author  Topic 

rkwagle
Starting Member

5 Posts

Posted - 2007-02-07 : 01:01:40
my stored procedure performs actions of deletion and insertion. Both the inserted and deleted items are output in temp tables with single column.
Is there a way to return the content of these two tables?
Is there a way to return a table from the stored procedure?

Thanks in advance
waamax

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-02-07 : 03:43:58
You can place SELECT statement at the end of SP so that the resultset will be returned from the SP as output.

Create Proc SomeProc
..
Begin
Set Nocount On

..
..
..

Select * from #temp1 Join #temp2 on <some-condition>
End


Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page
   

- Advertisement -