网络编程
位置:首页>> 网络编程>> 数据库>> sql数据库批量处理脚本

sql数据库批量处理脚本

 来源:asp之家 发布时间:2011-11-03 17:23:19 

标签: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

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com