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
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
相关文章推荐
- 在SqlServer存储过程中使用Cursor(游标)操作记录
- 在SqlServer存储过程中使用Cursor(游标)操作记录
- SqlServer存储过程中使用Cursor(游标)操作记录
- 在SqlServer存储过程中使用Cursor(游标)操作记录
- sqlserver 使用游标存储过程分页
- Sqlserver中存储过程和游标的一些使用例子
- JAVA6,请使用字符串加操作
- 在SQL Server中sqlserver,access,excel之间数据如何使用sql语句直接操作
- SQLserver游标原理和使用方法
- SQLServer游标(Cursor)简介和使用说明
- sqlserver游标使用误区
- 在Python中操作字符串之rstrip()方法的使用
- 使用WHILE代替游标的遍历操作
- go语言练习 : 编写一个非递归版本的comma函数,使用bytes.Buffer代替字符串链接操作。
- Java_正则表达式_推荐在复杂字符串操作中使用正则表达式
- PHP字符串操作介绍与使用
- c# 使用linq查询子句方式实现 字符串数组统计操作
- 编写一个函数reverse_string(char * string) 实现:将参数字符串中的字符反向排列。 要求:不能使用C函数库中的字符串操作函数。
- 使用 Newtonsoft.Json 操作 JSON 字符串
- 编写一个函数reverse_string(char * string)(递归实现)实现:将参数字符串中的字符反向排列。要求:不能使用C函数库中的字符串操作函数。