views:

28

answers:

1

In an app, where SQL server databases with schemas and locale unknown at compile-time (determined at runtime) can be plugged in, I need to figure out how to update a decimal field - ie. what decimal separator to use.

So against one server, if I need to update a decimal field, I would send 100.125. On another server that would be interpreted as 100,125.

I use oldschool SqlCommand-class to do so, since I do not know the schema at compile-time.

At runtime, can I determine which separator I should use? Or is there another way of handling this, that I am overlooking?

+1  A: 

There is some discussion on that issue here.

Can you supply some context to your query why just using a dot wouldn't work?

As far as I understand it

UPDATE tbl SET Col = 1.23 

would work anywhere and you would only get problems if you did

UPDATE tbl SET Col = '1.23'
Martin Smith