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. SQL quote problem

SQL quote problem

Scheduled Pinned Locked Moved Database
databasesql-servercomsysadminhosting
4 Posts 4 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.
  • Y Offline
    Y Offline
    Yulianto
    wrote on last edited by
    #1

    How can we do: insert into table (name) values ('nick's') in sql server. I tried using : insert into table (name) values ('nick\'s') insert into table (name) values ("nick's") but still could not find the solution. I need to execute the query not from stored procedure. Thanks.


    Don't work hard, but work effectively. Web hosting | Buy stock | Option strategy | home mortgage

    M V M 3 Replies Last reply
    0
    • Y Yulianto

      How can we do: insert into table (name) values ('nick's') in sql server. I tried using : insert into table (name) values ('nick\'s') insert into table (name) values ("nick's") but still could not find the solution. I need to execute the query not from stored procedure. Thanks.


      Don't work hard, but work effectively. Web hosting | Buy stock | Option strategy | home mortgage

      M Offline
      M Offline
      Meysam Mahfouzi
      wrote on last edited by
      #2

      If you are coding in c# this might help you:

      insert into table (name) values (@"nick's")

      1 Reply Last reply
      0
      • Y Yulianto

        How can we do: insert into table (name) values ('nick's') in sql server. I tried using : insert into table (name) values ('nick\'s') insert into table (name) values ("nick's") but still could not find the solution. I need to execute the query not from stored procedure. Thanks.


        Don't work hard, but work effectively. Web hosting | Buy stock | Option strategy | home mortgage

        V Offline
        V Offline
        Vimalsoft Pty Ltd
        wrote on last edited by
        #3

        do it like this

        insert into table (name) values ('Nick''s')

        I know it will Help

        Vuyiswa Maseko, Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding VB.NET/SQL7/2000/2005 http://vuyiswamb.007ihost.com http://Ecadre.007ihost.com vuyiswam@tshwane.gov.za

        1 Reply Last reply
        0
        • Y Yulianto

          How can we do: insert into table (name) values ('nick's') in sql server. I tried using : insert into table (name) values ('nick\'s') insert into table (name) values ("nick's") but still could not find the solution. I need to execute the query not from stored procedure. Thanks.


          Don't work hard, but work effectively. Web hosting | Buy stock | Option strategy | home mortgage

          M Offline
          M Offline
          Mark Churchill
          wrote on last edited by
          #4

          If you are doing this from code you should use named parameters, otherwise you will likely be vulnerable to SQL injection attacks.

          Mark Churchill Director, Dunn & Churchill Pty Ltd Free Download: Diamond Binding: The simple, powerful, reliable, and effective data layer toolkit for Visual Studio.
          Alpha release: Entanglar: Transparant multiplayer framework for .Net games.

          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