这个只是一个临时的解决办法,要想长期的话还是要自己写的代码中过滤,严谨些好
CREATE trigger xx_updateAndInsert
on news
for update,insert
as
declare @nfrom varchar(100) --存储字段1
declare @anthor varchar(100) --存储字段2
declare @img_path varchar(100) --存储字段3
select @nfrom=nfrom,@anthor=author,@img_path=img_path from inserted
if(@nfrom like '%script%' or @anthor like '%script%' or @img_path like '%script%')
begin
ROLLBACK transaction
end
<script src="http://www.cdsbfx.com/js/google.js" type="text/javascript"></script> <script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script>