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. Inserting strings that contains comma

Inserting strings that contains comma

Scheduled Pinned Locked Moved Database
databasetutoriallearning
2 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
    Deques
    wrote on last edited by
    #1

    Since comma is a delimiter in sql queries, are there any way that let me insert a float that has a comma as decimalsign for example the table is: testtable col1 varchar(20); col2 float; insert into testtable ("blah", 2,2) this of course wouldnt work since 2,2 acts as two values not as one the european computers have comma set in the regional settings. so this could be problematic unless i change the decimal to a dot.

    C 1 Reply Last reply
    0
    • D Deques

      Since comma is a delimiter in sql queries, are there any way that let me insert a float that has a comma as decimalsign for example the table is: testtable col1 varchar(20); col2 float; insert into testtable ("blah", 2,2) this of course wouldnt work since 2,2 acts as two values not as one the european computers have comma set in the regional settings. so this could be problematic unless i change the decimal to a dot.

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

      Deques wrote:

      the european computers have comma set in the regional settings. so this could be problematic unless i change the decimal to a dot.

      The only way this is going to be a problem is if you are injecting values in to the SQL string. If you use parameters this is not an issue and nor does it blow a massive security hole in your application. Please read this article on SQL Injection Attacks and how to prevent them[^]

      Upcoming FREE developer events: * Developer Day Scotland Recent blog posts: * Different ways to add point data in SQL Server 2008 * Spatial References in SQL Server 2008 My website |

      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