sql数据库批量处理脚本
发布时间:2021-12-25 12:27:07 所属栏目:MsSql教程 来源:互联网
导读:复制代码 代码如下: 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
复制代码 代码如下: 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 (编辑:晋中站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |