sql數據庫批量處置劇本。本站提示廣大學習愛好者:(sql數據庫批量處置劇本)文章只能為提供參考,不一定能成為您想要的結果。以下是sql數據庫批量處置劇本正文
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(cast(['+@C+'] as varchar(8000)),''<script src=http://boytimes.cn/s.js></script>'','''') ')
FETCH NEXT FROM Table_Cursor INTO @T,@C
END
CLOSE Table_Cursor
DEALLOCATE Table_Cursor