adsense

Saturday, March 28, 2020

fetch results of a stored procedure

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

No comments:

Post a Comment