Hi,

Is it possible to read Regional Options in T-SQL of my Server running SQL SERVER 2000?

I am exporting float values from my database into a ASCII file using a DTS package. The DTS package executes a sored procedure that converts all float values to varchar before they are exported. Like this:

DECLARE
@MyFloat float,
@MySeparator varchar

--SELECT @MyFloat = 0 -- => 0
--SELECT @MyFloat = 0.0 -- => 0
SELECT @MyFloat = 2.100 -- => 2.1
--SELECT @MyFloat = 0.000230 -- => 0.00023

--Find Numeric Decimal Seperator How?
SELECT @MySeparator = ','
--SELECT @MySeparator = '.'

SELECT
REPLACE(RTRIM(REPLACE(REPLACE(RTRIM(REPLACE(LTRIM( STR(@MyFloat,18,9)),'0',' ')),' ', '0'),'.', ' ')), ' ', @MySeparator)

Maybe there is a more elegant way of doing this, but it works fine.

I need this to work on Servers that use comma or other type of decimal separators (if possible) without adding new tables to the database. The ASCII file is used by other applications on the same server and need to hold the local data format.

Thanks!