declare @n int declare @rowcount int declare @name varchar(50) create table #temp ( id int identity(1,1), employeeName nvarchar(100) ) insert into #temp select name from employee set @rowcount=@@rowcount set @n=1 while @n<@rowcount begin select @name=employeename from #temp where id=@n print(@name) set @n=@n+1 end drop table #temp
时间: 2024-10-16 01:14:18