如何清除/重置/删除循环中的临时创建表?
Another loop at the top with extra code...
How do I reset/drop the declared table up here or below?
Declare @Aresource table(idr int identity(1,1), id int)
Insert into @Aresource (id)
SELECT idr = AssignmentImageId
FROM VLP2014..Assignment
Where AssignmentId = @ida
Declare @ari int
Declare @aricnt int
select @ari = min(idr) - 1, @aricnt = max(idr) from @Aresource
While @ari < @aricnt
Begin
Select @ari = @ari + 1
Declare @arid int
select @arid = id from @Aresource where idr = @ari
How do I reset/drop the declared table here?
some more code...
我已经尝试过正常的 DROP TABLE(如果存在),但由于它已声明(临时表),我似乎无法调用它。