declare qc_cursor cursor SCROLL OPTIMISTIC For
select siteName from tb_vhostcheck
open qc_cursor
declare @siteName nvarchar(50)
while @@fetch_status=0
begin
fetch next from qc_cursor into @siteName
--print @siteName
if not exists(select 1 from vhhostlist where s_comment= @siteName)
begin
print @siteName
delete from tb_vhostcheck where [email protected]
end
end
close qc_cursor
deallocate qc_cursor
时间: 2024-12-24 04:20:26