Unanswered: Money data type for handling comma instead period
I have created a table with money datatype by default it accepts period for decimal degit, But if I change the regional settings with Italian format, I am getteting error in insert statement due to comma in the money format. I would like to write insert statement that works for both and US and italian format, Please help me.
Re: Money data type for handling command instead period
Me personally, I would avoid the money data type and use an integer data type. You have to do more work on the front end to handle displaying information, but I have read of too many instances of rounding errors being introduced because of decimal data types (money, decimal, float, real).
But I have already developed the product it is difficult for me to change the data structure at this time. I am just trying to find out some solution here. Is it possible for me to use syntax like cast or convert to solve this issue?
And when could you ever insert a comma in a number? It would think it's another data element...
CREATE TABLE myTable99 (Col1 money)
INSERT INTO myTable99(Col1) SELECT 12345678.1234
INSERT INTO myTable99(Col1) SELECT 12345678.8765
SELECT SUM(Col1) FROM myTable99
INSERT INTO myTable99(Col1) SELECT 12,345,678.1234
DROP TABLE myTable99