Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Handling quote marks in sql?

Handling quote marks in sql?

Scheduled Pinned Locked Moved Database
databasedockeralgorithmsquestionannouncement
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    davebarkshire
    wrote on last edited by
    #1

    I currently strip out any quote marks from data input (and many other characters) when sending data to the database but would like the user to be able to enter quote marks if they wish. I use mostly stored procedures to update data but often compose sql on the fly for ad hoc searching. Can anyone tell me how I should be handling the characters which are used in T-SQL such as ' and % Thanks in advance - Dave

    C 1 Reply Last reply
    0
    • D davebarkshire

      I currently strip out any quote marks from data input (and many other characters) when sending data to the database but would like the user to be able to enter quote marks if they wish. I use mostly stored procedures to update data but often compose sql on the fly for ad hoc searching. Can anyone tell me how I should be handling the characters which are used in T-SQL such as ' and % Thanks in advance - Dave

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      davebarkshire wrote: Can anyone tell me how I should be handling the characters which are used in T-SQL such as ' and % Use parameterised queries. davebarkshire wrote: compose sql on the fly for ad hoc searching It also sounds like you should read up on SQL Injection Attacks[^]


      Do you want to know more? WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and Forums

      D 1 Reply Last reply
      0
      • C Colin Angus Mackay

        davebarkshire wrote: Can anyone tell me how I should be handling the characters which are used in T-SQL such as ' and % Use parameterised queries. davebarkshire wrote: compose sql on the fly for ad hoc searching It also sounds like you should read up on SQL Injection Attacks[^]


        Do you want to know more? WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and Forums

        D Offline
        D Offline
        davebarkshire
        wrote on last edited by
        #3

        Nothing but porn on that link.

        C 1 Reply Last reply
        0
        • D davebarkshire

          Nothing but porn on that link.

          C Offline
          C Offline
          Colin Angus Mackay
          wrote on last edited by
          #4

          :wtf: What the.... Here is the link again: http://www.codeproject.com/useritems/SqlInjectionAttacks.asp[^]


          Do you want to know more? WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and Forums

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups