If you want to get results of a executed stored procedure, there few ways you can achieve the goal.
1. using openrowset
SELECT * INTO #TempTable FROM OPENROWSET('SQLNCLI', 'Server=(local)\SQL2008;Trusted_Connection=yes;',
'EXEC getOrderHistory')
SELECT * FROM #TempTable
2. using temporary table
INSERT INTO #TempTable
Exec getOrderHistory 'Params'
Regards,
Samitha
1. using openrowset
SELECT * INTO #TempTable FROM OPENROWSET('SQLNCLI', 'Server=(local)\SQL2008;Trusted_Connection=yes;',
'EXEC getOrderHistory')
SELECT * FROM #TempTable
2. using temporary table
INSERT INTO #TempTable
Exec getOrderHistory 'Params'
Regards,
Samitha