通过sysobjects和syscolumns系统表,找到每个表的每个列,如果列类型是字符串类型的,比如varchar、nvarchar等,利用游标,对这些列进行更新。
下边写了个例子,你需要修改的地方
a.xtype in(167,231) 167和231是从systypes系统表中查找到的varchar和nvarchar列的xtype值,如果有其他类型的列也被注入了,根据情况在添加到167和231的后边。
还有,更新语句
set @sqlstr='update ['+@tname+'] set ['+@colname+']=replace(['+@colname+'],'''','''')'
中的<script>...</script>那一块根据实际被注入的内容修改。
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn