Q
Problem solve Get help with specific problems with your technologies, process and projects.

Capturing recordsets generated by stored procedures

Is there a possibility to "capture" the recordsets generated by the call of a stored procedure into something (temporary table, cursor(s), or even something else)? I don't want to change anything in that stored procedure!

Your T-SQL code would look roughly like this...

 CREATE TABLE #table_temp( column1 int null, column2 varchar(20) null ) /*Your column data types and number of columns would match the columns in the recordset generated by the stored procedure*/ INSERT INTO #table_temp EXEC usp_my_procedure /* Anything you would want to do with the #table_temp would go here. */ DROP TABLE #table_temp

 

For More Information

Dig Deeper on Microsoft SQL Server Installation

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchBusinessAnalytics

SearchDataCenter

SearchDataManagement

SearchAWS

SearchOracle

SearchContentManagement

SearchWindowsServer

Close