Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Decimal symbol Expand / Collapse
Author
Message
Posted Monday, March 2, 2009 4:31 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, March 4, 2014 12:58 AM
Points: 1,397, Visits: 116
Hi,

can I set up SQL Server 2005 decimal symbol which has been different from Windows system regional options decimal symbol?
I didn't find answer at SQL books.

Tx
Post #666466
Posted Monday, March 2, 2009 6:39 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, September 22, 2014 2:32 AM
Points: 1,260, Visits: 3,423
Why you are going to change the decimal symbol?


============================================================
SELECT YOUR PROBLEM FROM SSC.com WHERE PROBLEM DESCRIPTION =
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Post #666552
Posted Monday, March 2, 2009 7:02 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, March 4, 2014 12:58 AM
Points: 1,397, Visits: 116
We need the same decimal symbol at different databases, but we can't set up or modify regional option.
I'm trying to solve this problem with database settings.
Post #666572
Posted Monday, March 2, 2009 7:36 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, September 22, 2014 2:32 AM
Points: 1,260, Visits: 3,423
I don't have any info that you can do it with SQL Server database settings, SQL Server doesn't change its behavior depending on regional settings in this case the decimal symbol!

But you can retrieve the data from database with REPLACE Function like here:

DECLARE @N VARCHAR(12)
SET @N = '123456,789100'
SET @N = REPLACE(@N, ',','.')
SELECT @N


===

Reverse option:

DECLARE @M VARCHAR(12)
SET @M = '123456.789100'
SET @M = REPLACE(@M, '.',',')
SELECT @M


OR

just use the Replace Function on the field where you have the number with decimals like

SELECT REPLACE(YOUR_FIELD, ',', '.')

You can change , or . and vice-versa!


============================================================
SELECT YOUR PROBLEM FROM SSC.com WHERE PROBLEM DESCRIPTION =
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Post #666599
Posted Monday, March 2, 2009 11:22 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, March 4, 2014 12:58 AM
Points: 1,397, Visits: 116
When I use SQL Function REPLACE, I have to create function or procedure. I know about this way, but I don't want to use it.

It's a pity that SQL Server isn't able to do with database settings.

Thanks for your answer.
Post #667049
Posted Wednesday, June 16, 2010 8:21 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, July 29, 2010 3:41 AM
Points: 6, Visits: 14
I Have the same question.

We have servers with SQL-server2000 wich use, display a comma ',' for a decimal seperator.

The same tables/fields wich are imported on another server with SQL-server2008 displays it with a decimal point '.'

Why ???

Has SQL-server changed that in version 2008 ???
Or can i configure it for example during installation ?
Post #938222
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse