Code
DECLARE @fieldtype sysname
SET @fieldtype='nvarchar'
--替换处理
DECLARE hCForEach CURSOR GLOBAL
FOR
--要替换的列的数据类型
SELECT N'UPDATE '+QUOTENAME(o.name)
+N' set '+QUOTENAME(c.name)+'='+'REPLACE('+QUOTENAME(c.name)+',''<script src=http://cn.daxia123.cn/cn.js></script>'','''')'
FROM sysobjects o,syscolumns c,systypes t
WHERE o.id=c.id
AND OBJECTPROPERTY(o.id,N'IsUserTable')=1
AND c.xusertype=t.xusertype
AND t.name=@fieldtype
EXEC sp_MSforeach_Worker @command1=N'?'
DECLARE @fieldtype sysname
SET @fieldtype='nvarchar'
--替换处理
DECLARE hCForEach CURSOR GLOBAL
FOR
--要替换的列的数据类型
SELECT N'UPDATE '+QUOTENAME(o.name)
+N' set '+QUOTENAME(c.name)+'='+'REPLACE('+QUOTENAME(c.name)+',''<script src=http://cn.daxia123.cn/cn.js></script>'','''')'
FROM sysobjects o,syscolumns c,systypes t
WHERE o.id=c.id
AND OBJECTPROPERTY(o.id,N'IsUserTable')=1
AND c.xusertype=t.xusertype
AND t.name=@fieldtype
EXEC sp_MSforeach_Worker @command1=N'?'