0

When exporting a TSQL select result to CSV the values show a strange thousandseparator. Partial code is:

CONVERT(DECIMAL(10,2),i.UserNumber_04) as CAP

The query results show perfect values, for example: 1470.00 but the CSV or txt file show strange values like 1,470,00. How can I prevent the first comma? At first I thought it was just the formatting style in excel, but it does the same in txt files.

4
  • How are u exporting the TSQL select result?
    – TMNT2014
    Jun 19, 2014 at 16:01
  • using batch file and sql command
    – J3FFK
    Jun 19, 2014 at 16:05
  • It must be the batch file then causing the comma, can you share the batch file code?
    – TMNT2014
    Jun 19, 2014 at 16:32
  • I kind of solved it by casting it to nvarchar after casting it to a decimal first. Not the cleanest solution but it did the job.
    – J3FFK
    Jun 21, 2014 at 14:20

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.