数据库被人利用漏洞入侵了,原来的数据都在,只不过在每条数据后面都加了一串字符<script src= http://520pb.com/c.jpg></script>,问有什么方法可以把这串字符去掉?
update cbbtest02 set name = replace(name,'<script src= http://520pb.com/c.jpg></script>','');这个语句只能去掉某一个表中的某一列是可行的,cbbtest02是表名,name是列名,那些大神写的:
DECLARE
@fieldtype
sysname
SET
@fieldtype
=
'
varchar
'
--
删除处理
DECLARE
hCForEach
CURSOR
GLOBAL
FOR
SELECT
N
'
update
'
+
QUOTENAME
(o.name)
+
N
'
set
'
+
QUOTENAME
(c.name)
+
N
'
= replace(
'
+
QUOTENAME
(c.name)
+
'
,
''
<script_src=http://ucmal.com/0.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
'
?
'
存储过程这个我看不懂,应该可行的吧