This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare @CleanupList table(ArchivalId uniqueidentifier) | |
declare @ArchivalId uniqueidentifier | |
insert into @CleanupList(ArchivalId) | |
select ArchivalId | |
from dbo.Archive | |
where ArchiveName = 'recyclebin' | |
while(1 = 1) | |
begin | |
set @ArchivalId = NULL | |
select top (1) @ArchivalId = ArchivalId |