如果写
DROP TABLE tableA
怎么办?!你不会把用户输入的东西直接执行吧?!

解决方案 »

  1.   

    select * from marinegoods --where jobno = 'DROP TABLE marinegoods'
    select * from marinegoods where jobno = 'DROP TABLE marinegoods'
      

  2.   

    不要让用户直接写脚本执行什么操作让他选一选,填一填,点一点
    把用户的所填的作为存储过程的参数,而不要直接拼到sql脚本里
      

  3.   

    用户输入:
    ' or '1' = '1select * from marinegoods where jobno = '' or '1' = '1'用作存储过程的的参数就不要紧了
    select * from marinegoods where jobno = @UserInput