Copying of null floats


Hello, We have a table that contains a float column that allows nulls.

When copying to azure the result is that the null float columns are converted in to the value 0.

I can't see this happening with any other data types (as far as I can tell anyway).

Obviously 0 and null are very different animals


ghuey wrote Oct 14, 2013 at 6:48 PM


I don't actually touch the data myself. That is all done through BCP. I use BCP for output and input. You might try playing with the BCP parameters. You can edit SQLAzureMW.exe.config find:

<add key="BCPArgsOut" value=""{0}" out {1} -E -n -C RAW"/>

You might want to delete -C RAW and then try that. You also might want to migrate to a local SQL Server database and rule out SQL Database. If none of that works, if you want, you can send me the schema of the table that is causing the issue and I will play with it and see what I can figure out.


Hahndorf wrote Oct 20, 2013 at 1:07 PM

bcp.exe by default uses default values when a NULL value is found in the data (see TechNet article)

If this is a problem for you (and it was for me) add the -k switch to the BCPArgsIn parameters in the config file.

JohanDanforth wrote Mar 20 at 7:06 PM

I can confirm this, I modified the config-file to this:
<add key="BCPArgsIn" value="{0} in {1} -k -E -n -b 10000 -a 16384"/>  
<add key="BCPArgsOut" value="&quot;{0}&quot; out {1}  -k -E -n -C RAW"/>   
I believe it's the "in" arguments that does it, but this did it :)