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