SQL Server数据库内容替换方法

declare @ptr varbinary(16)

declare @artId int

SQL Server数据库内容替换方法

declare @Position int,据库@len int

set @len = datalength(老字符串)

declare wux_Cursor scroll Cursor

for

select textptr([字段名]),[key字段名] from [数据表名]

for read only

open wux_Cursor

fetch next from wux_Cursor into @ptr,@artId

while @@fetch_status=0

begin

select @Position=patindex(%老字符串%,[字段名]) from [数据表名] where [key字段名]=@artId

while @Position>0

begin

set @Position=@Position-1

updatetext [数据表名].[字段名] @ptr @Position @len 新字符串

select @Position=patindex(%老字符串%,[字段名]) from [数据表名] where [key字段名]=@artId

end

fetch next from wux_Cursor into @ptr,@artId

end

close wux_cursor

deallocate wux_cursor

go

时尚
上一篇:重装电脑脚本错误的解决方法(快速修复电脑重装脚本错误的技巧)
下一篇:简单高效的pe一键装机教程(零基础用户也能轻松搞定的pe装机指南)