摘要:
DECLARE @ID int--定义游标DECLARE MyCursor CURSORFOR SELECT ID FROM tbclass_1--打开一个游标OPEN MyCursor--循环一个游标FETCH NEXT FROM MyCursor INTO @IDWHILE @@FETCH_STATUS =0BEGIN --sql代码块 FETCH NEXT FROM MyCursor INTO @IDENDCLOSE MyCursor --关闭游标DEALLOCATE MyCursor --释放游标 阅读全文