2014年7月10日 星期四

MsSql DECLARE CURSOR 資料指標

Set Nocount ON;
declare  @a nvarchar(100),@b nvarchar(100),@c int
Declare db Cursor For select a,b  from  Test  order by a 
Open db
Fetch Next From f into @a, @b
While @@Fetch_Status = 0
Begin
   //Do Something
  fetch next from db into @a, @b
End 
Close db;
Deallocate db;

沒有留言:

張貼留言