Exec stored procedure into dynamic temp table

后端 未结 4 1070
[愿得一人]
[愿得一人] 2020-12-10 03:55

To my knowledge; what I want to do is not possible in sql, but it is worth asking you guys.

Lets say I have a stored procedure abc that returns columns Id and Value.

4条回答
  •  孤街浪徒
    2020-12-10 04:20

    SELECT * INTO #TempTable 
    FROM OPENROWSET
    ('SQLNCLI','Server=(local)\SQL2008R2;Trusted_Connection=yes;',
         'EXEC OtherDb.DataProd.abc')
    
    SELECT * FROM #TempTable
    

提交回复
热议问题