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 2000 Forums
 SQL Server Development (2000)
 Exec SP and get results within another SP

Author  Topic 

jaroot
Starting Member

46 Posts

Posted - 2005-06-16 : 17:05:35
I've googled it already because I thought it would be fairly simple, but I can't seem to find syntax that works.

Anyone have any samples that I can look at?

Also I'm using a temp table so SQL 2K won't let me have it as a UDF for some reason.

Thanks!

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-06-16 : 17:35:42
CREATE PROC dbo.ParentProc
AS

CREATE TABLE #Temp ()

INSERT INTO #Temp
EXEC dbo.ChildProc

DoSomethingWith#Temp

DROP TABLE #Temp

RETURN

GO

Tara
Go to Top of Page

rockmoose
SQL Natt Alfen

3279 Posts

Posted - 2005-06-16 : 17:39:27
You have to create a table to hold the results of the sp first:

create table #mytable(<same layout as return of sp>)
insert #mytable(<column_list>)
exec mysp

Edit:
I have to work on mmy typing skills

rockmoose
Go to Top of Page

jaroot
Starting Member

46 Posts

Posted - 2005-06-16 : 18:01:30
thanks guys
Go to Top of Page
   

- Advertisement -