How can we insert stored procedure result in a temporary table.
CREATE PROC spGetDateListASBEGINSELECT GETDATE() AS [DATE] UNION ALLSELECT GETDATE()+1 AS [DATE] UNION ALLSELECT GETDATE()+2 AS [DATE] UNION ALLSELECT GETDATE()+3 AS [DATE] UNION ALLSELECT GETDATE()+4ENDGOsp_configure 'Show Advanced Options', 1GORECONFIGUREGOsp_configure 'Ad Hoc Distributed Queries', 1GORECONFIGUREGOSELECT * INTO #TempTable FROMOPENROWSET('SQLNCLI', 'Server=ServerInstanceName;Trusted_Connection=yes;','EXEC Database.Schema.StoredProcedure')
That’s It
Enjoy Learning.
Enjoy Learning.
No comments:
Post a Comment