利用游标修改、删除数据
declareauth_curcursor scrollfor
selectau_id,au_lname,au_fname,state
fromauthors for update of au_lname
openauth_cur
declare @rowcount int
set @rowcount = 6
fetch absolute @rowcount from auth_cur --将变量@rowcount标识的行设置为当前行
--下面1行是利用游标进行修改操作
update authors set au_lname='张' where current of auth_cur --修改游标中的当前行
--下面1行是利用游标进行删除操作
delete from authors where current of auth_cur
优质内容筛选与推荐>>