更新NTEXT的方法

declare

@id numeric ( 18 , 0 )

DECLARE

ResultSet_News CURSOR FOR

SELECT

Id FROM product_ta_product ;

OPEN

ResultSet_News ;

FETCH

NEXT FROM ResultSet_News into @Id

WHILE

@@FETCH_STATUS = 0

BEGIN

print @id

DECLARE

@CommentVar nvarchar ( 4000 );

-- Read in existing comments from COMMENTS column in view named MyView

SELECT

@CommentVar = product_description FROM product_ta_product WHERE id = @id ;

-- Insert text a top of comment (example is a running history with most recent first)

SET

@CommentVar = replace ( @CommentVar , 'http://www.4wdcc.com/admin' , 'http://www.leods.com/admin' );

-- Now go update the field

UPDATE

product_ta_product SET product_description = @CommentVar WHERE id = @id ;

 

FETCH NEXT FROM ResultSet_News into @Id

END ;

CLOSE

ResultSet_News ;

DEALLOCATE

ResultSet_News ;

转载于:https://www.cnblogs.com/miaomiaoga/archive/2006/07/31/463858.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值