declare @temp table
(
   [id] int IDENTITY(1,1),
   [Name] varchar(10)
)
declare @tempId int,@tempName varchar(10)

insert into @temp values('a')
insert into @temp values('b')
insert into @temp values('c')
insert into @temp values('d')
insert into @temp values('e')

WHILE EXISTS(select [id] from @temp)
begin
select top 1 @tempId = [id],@tempName=[Name] from @temp
delete from @temp where [id] = @tempId
print  'Name:----'+@tempName
end

相关文章:

  • 2022-12-23
  • 2021-12-18
  • 2021-12-18
  • 2021-11-03
  • 2021-12-04
  • 2022-03-02
  • 2022-12-23
  • 2021-08-26
猜你喜欢
  • 2022-12-23
  • 2021-07-15
  • 2021-11-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案