摘要: 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 --释放游标 阅读全文
posted @ 2011-09-27 13:14 suger 阅读(6901) 评论(0) 推荐(2) 编辑