SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


How to execute stored procedure and save the results into temp table in mssql 2000


How to execute stored procedure and save the results into temp table in mssql 2000

Author
Message
raghuldrag
raghuldrag
SSCrazy
SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)

Group: General Forum Members
Points: 2658 Visits: 573
Hi friends,

I have one stored procedure Test_db_list it ll display result depends on date range i have to store this results into temp table of another procedure

Kindly give suggestion
anthony.green
anthony.green
SSC Guru
SSC Guru (100K reputation)SSC Guru (100K reputation)SSC Guru (100K reputation)SSC Guru (100K reputation)SSC Guru (100K reputation)SSC Guru (100K reputation)SSC Guru (100K reputation)SSC Guru (100K reputation)

Group: General Forum Members
Points: 100482 Visits: 8698
raghuldrag - Thursday, December 7, 2017 12:30 AM
Hi friends,

I have one stored procedure Test_db_list it ll display result depends on date range i have to store this results into temp table of another procedure

Kindly give suggestion


Create a ## temp table, insert the result set into the ## temp from SP1, execute SP2, drop ## temp, need to ensure the code of SP2 references the ## temp table


CREATE TABLE ##Temp (ID INT)
go
INSERT INTO ##Temp
EXEC SP1
go
EXEC SP2
go
DROP TABLE ##TEMP





How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger


aaron.reese
aaron.reese
SSChampion
SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)

Group: General Forum Members
Points: 11167 Visits: 1062
MSSQL 2000!

Please don't use this for production Smile
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search