user2675045
user2675045

Reputation: 193

bcp change value "," (komma) to "." (dot)

I found out: if I do a

select Artikelnummer,Listenpreis*1.19 as money from [SL_M03KNE].[dbo].[ARKALK]

i get: 5,59

If i do a

EXEC master..xp_cmdshell 'bcp "select Artikelnummer,Listenpreis*1.19 as money from [SL_M03KNE].[dbo].[ARKALK]" queryout "D:\shop\xml\Artikelpreise_ohne.csv" -E -c -T -x

i found in the csv File the Value 5.59

the bcp do a conversion from the komma to dot. How can i do it that the original 5,59 was insert in the csv?

Upvotes: 1

Views: 1068

Answers (1)

Andomar
Andomar

Reputation: 238048

By default, bcp ignores regional settings. From SQL Server 2012, you can use bcp -R to honor regional settings.

If you are using an older version of SQL Server, consider formatting the output in your query. For example, use replace to change dots to commas:

select replace(convert(varchar(50), Listenpreis*1.19), '.', ',')

Upvotes: 1

Related Questions