今天学习游标,已经开始啦..............
use zf
go
--声明游标
declare cursor_name cursor
for select * from dbo.TBL_JD
use zf
go
--打开游标
open cursor_name
--检索行数据
fetch next from cursor_name
--通过游标修改行数据
update TBL_JD set jd='中关村' where current of cursor_name
--通过游标删除数据
delete from TBL_JD where current of cursor_name
--关闭游标
close cursor_name
--释放游标
deallocate cursor_name