declare @t varchar(255),@c varchar(255) 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(convert(varchar(8000), [' +@c+ ']), ''/* 악성코드 */'','''')')
fetch next from table_cursor into @t,@c
end
close table_cursor
deallocate table_cursor
/* 악성코드 */ 이렇게 표시된 부분에 없애고자하는 문자열을 넣은뒤 SQL 스크립트 실행창 붙여넣고 실행하면 됨.
사용법
스크립트 파일을 열어보면
arr_Replacetxt = split(strReplace,"|")
이런 곳에 삭자하고자하는 문자열을 넣고 저장후 사용하면됨.
여러 문자열을 넣을때는 파이프라인으로 구분하여 삭제하면 됨.
dos 창을 띄우고서
c:\>cscript Replace_string_081117.vbs
하면 실행됨