Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Cast and Convert

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-12-22 : 08:04:33
John Knight writes "Hello,
I am developing a SQL 2000 based application for an Italian customer. In order for the application to work I need to convert numeric strings (from another database) into data type of float. The problem is that on a computer using UK locale settings the convert/cast function works on a string "0.39". As soon as I obtain the customers database and use the same stored procedure on "0,39" (with Italian locale settings) the cast function fails. Is the cast/conversion function independant of the locale settings ie: would I need an Italian installation of SQL for this to work?

Any help would be GREATLY appreciated.

Thanks

John"

mohdowais
Sheikh of Yak Knowledge

1456 Posts

Posted - 2003-12-22 : 08:49:55
An Italian installation of SQL Server will not help...I think the problem is that your numbers have been stored in a column of char or varchar datatype. If you use a numeric or decimal datatype, the operating system should take care of formatting issues.

Owais

We make a living out of what we get, but we make a life out of what we give.
Go to Top of Page

Granick
Starting Member

46 Posts

Posted - 2003-12-22 : 13:18:42
Assuming you have only "numeric" values in the field, you should be able to use the REPLACE function and do a replace on the comma, to make it look like the 0.39, so that the CAST/CONVERT will work, then store the valuee.

Make sense?

Shannon
Go to Top of Page
   

- Advertisement -