Wednesday, March 7, 2012

Obtaining data from an EXEC

Hi all,

I have a stored procedure which returns a recordset of data. What I want to do is execute this stored procedure in another stored procedure and insert the recordset returned into a temporary table.

ie.

Stored Procedure Test1 may perform the following action: -
SELECT * FROM MyTable1

Stored Procedure Test2 would do something like this: -

EXEC Test1

INSERT INTO #TempTable {The recordset returned from Test1}

Any ideas how I would go about this?

Cheers,

Robchange sp Test2 to:

insert into #TempTable
execute Test1|||Novice Brain Surgeon is an appropriate labal, you're a star.

Cheers,

Rob|||Actually, I hated the "Guru" label and was trying to be cute.

No comments:

Post a Comment