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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Determine multiple tables from an SP
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

1 Posts

Posted - 06/05/2006 :  07:36:16  Show Profile  Reply with Quote
Hi, I am calling one sp say spABC from another sp say spXYZ. spABC returns 3 tables. How can i identify 3 distinct tbles in my calling sp? I need to set values in all tables depending on the value in one column of one table.

Flowing Fount of Yak Knowledge

6065 Posts

Posted - 06/05/2006 :  07:58:39  Show Profile  Reply with Quote
what do you mean when you say, "spABC returns 3 tables"?
If you mean 3 seperate result sets, you won't be able to capture them in a calling SP unless all result sets have the same columns returned. If they do you could:

insert #temp(<colList>)
exec myCalledSP

But again, the SP can't return one or more Sql Server Table objects. They can only return result sets, output variables (not of table type), and return codes.

Be One with the Optimizer
Go to Top of Page

Premature Yak Congratulator

22864 Posts

Posted - 06/05/2006 :  08:56:07  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
If you use front end application like vb, asp, etc, make use of RecordSet and its NextRecordSet

--rs("col") first result set
Set Rs=Rs.NextRecordSet
--rs("col") Second result set
Set Rs=Rs.NextRecordSet
--rs("col") third result set


Failing to plan is Planning to fail

Edited by - madhivanan on 06/05/2006 08:57:43
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000