您的位置:首页 > 数据库

sqlserver 游标的使用(字符串操作)

2012-06-26 08:41 323 查看
declare @word varchar(3000),@fid int,@wordnew varchar(3000)
declare cur cursor
for select fid,fmemo from fp_food where istc=0
open cur
fetch next from cur into @fid,@word
while @@fetch_status = 0
begin
set @wordnew=@word + CHAR(10) + char(10) + '菜品以实物为准'
update fp_food
set fmemo=@wordnew
where fid=@fid
fetch next from cur into @fid,@word
end
close cur
deallocate cur
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: