就像我宣布一张桌子......
declare @tempTable TABLE
(Id bigint identity(1,1),
bKey int,
DateT DateTime,
Addres nvarchar(max),
unit bigint)
Run Code Online (Sandbox Code Playgroud)
而且我想放弃它...但是我被卡住了下降表n截断不起作用.
ani ideaaa ...... ???
表变量仅在范围内时存在,在您的情况下,存储过程的持续时间.一旦程序完成,它将自行删除.
你可能会想到一个临时表:
CREATE TABLE #MyTempTable
Run Code Online (Sandbox Code Playgroud)
临时表和表变量之间存在差异:
http://sqlnerd.blogspot.com/2005/09/temp-tables-vs-table-variables.html
一个更好的链接:
http://www.sql-server-performance.com/articles/per/temp_tables_vs_variables_p1.aspx