By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,659 Members | 1,714 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,659 IT Pros & Developers. It's quick & easy.

Output of SP1 stored procedure in #Temp TABLE OF SP2.

P: 41
Hello ..

I want Output of SP1 stored procedure in #Temp TABLE OF SP2.

Something like this .......

CREATE SP2
@iLoginId INT
AS
BEGIN
SELECT *
INTO #Temp
FROM [SP1]

SELECT TOP 20
FROM #Temp

END

--Regards
Jan 30 '09 #1
Share this Question
Share on Google+
5 Replies


ck9663
Expert 2.5K+
P: 2,878
If you create the temp table inside your stored proc, it will not be visible outside that stored proc.

There might be other ways of doing it. What are you trying to do?

-- CK
Jan 30 '09 #2

P: 41
@ck9663
Hello

i am trying to SELECT TOP 10 recordes of output of SP1 from SP2.

-- Regards
Jan 31 '09 #3

ck9663
Expert 2.5K+
P: 2,878
Try using a table function.

-- CK
Jan 31 '09 #4

P: 41
@ck9663
Hello

Thanks for the reply.

With Table function problem is that i have to know table schema before creating table function.

But i am executing any sp [SP1 is name of stored procedure passed to SP2] so i dont know table schema.

so give me any idea..

--Regards,
Feb 3 '09 #5

ck9663
Expert 2.5K+
P: 2,878
Could you oist some sample data and what you're trying to accomplish?

-- CK
Feb 3 '09 #6

Post your reply

Sign in to post your reply or Sign up for a free account.