是否可以在 SQL Server 2008 中截断或刷新表变量?
declare @tableVariable table
(
id int,
value varchar(20)
)
while @start <= @stop
begin
insert into @tableVariable(id, value)
select id
, value
from xTable
where id = @start
--Use @tableVariable
--@tableVariable should be flushed out of
-- old values before inserting new values
set @start = @start + 1
end
最佳答案
删除所有内容
DELETE FROM @tableVariable
关于sql - SQL Server 2008 中截断/清除表变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22046487/