本文介紹了SQL Server:將存儲過程結果集放入表變量而不指定其架構的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我有一個帶有很多參數的存儲過程.
I have a stored procedure with many parameters.
我想像這樣插入(或者選擇):
I want to insert (or maybe select) like this:
INSERT INTO @TEMP_TABLE
EXECUTE STORED_PROCEDURE
沒有定義@TEMP_TABLE
的模式.
推薦答案
你不能用 @tablevariable
做到這一點.
You cannot do this with a @tablevariable
.
發布的鏈接中的解決方法by Joe 使用 SELECT ... INTO
.
表變量當前不支持此功能(并且永遠不會來自對 這個連接項)作為表變量的架構需要在編譯時知道.
This is not currently supported by table variables (and won't ever be from the response to this connect item) as the schema for table variables needs to be known at compile time.
這篇關于SQL Server:將存儲過程結果集放入表變量而不指定其架構的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!