The following bcp command is auto converting empty strings to nulls:
BCP "stored_proc_name" queryout C:\Outdir\data.csv -c -t , -T -Sserverx -Uusery -Ppassz -dproddb
I need the empty strings to be retained and not be replaced by NULLs.
What's the best way to do this? Can the bcp auto conversion be turned off?
That is by design:
The workaround is in your stored procedure, when issuing
SELECT
, useNULLIF()
orCOALESCE()
function to output aNULL
instead.