Read&Write Numbers to .txt using ETL and SQL
<p>I'm writing a .txt from an .xls file.
I'm using JasperETL to read the excel and insert data into MSSQL and then write the .txt file.</p>

<p>In the excel file, i have a Number (amount of money) that looks like this <code>20.000,00</code> but sometimes, due to regional settings, that number is imported in SQL as <code>20,000.00</code> (separators are inverted - , becomes . and . becomes ,).</p>

<p>My final format needs to look like this <code>20000.00</code> and for that i'm using the REPLACE function in MSSQL.</p>

<p>Is there any way, using a T-SQL query, to overcome this issue?</p>

<p>I've been thinking to use the old way and make CASES for each possible format, something like this.</p>

<pre><code>CASE WHEN sum like 'x.xxx,xx' THEN...
WHEN sum like 'x,xxx.xx' THEN...
</code></pre>

<p>But i'm also looking for alternatives.</p>

<p>Thanks in advance,</p>