使用sqlserver中的函数功能,如何使用循环处理查询结果,具体方法如下:
declare @id int
declare mycur cursor for
select id from table where ID > 100
open mycur
fetch next from mycur into @id
WHILE @@FETCH_STATUS = 0
BEGIN
exec 具体方法 @id
fetch next from mycur into @id
END
close mycur
deallocate mycur