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
 Transact-SQL (2005)
 return Multiple result sets

Author  Topic 

zhshqzyc
Posting Yak Master

240 Posts

Posted - 2008-12-04 : 19:59:01
return Multiple result sets from a stored procedure
Hello,

In a stored procedure, I create two temp tables.
May I return the two result sets?

Thanks

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-12-04 : 20:07:00
Yes.

SELECT * FROM #temp1
SELECT * FROM #temp2

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

zhshqzyc
Posting Yak Master

240 Posts

Posted - 2008-12-04 : 20:39:22
I saw an article saying a semicomma needed. Is it right?
SELECT * FROM #temp1;
SELECT * FROM #temp2

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-12-04 : 22:32:52
It is not required.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -