Brayan Pastor
Brayan Pastor

Reputation: 984

Sql server bcp export binary in csv, How do I replace it with ''?"

I have a table that has an empty composition

enter image description here

when exporting it with bcp, it exports it in the following way; with the character "?"

bcp  table out table.csv -S local -U sa -d BD -c -t '|'

enter image description here

some solution to this problem, from bcp

enter image description here enter image description here enter image description here

Upvotes: 1

Views: 679

Answers (2)

Synapsis
Synapsis

Reputation: 1017

Had the same problem and solved with

 -k

Hope it works for you too ;)

Well, of course it won't work... those field are set not to be NULL. You should change that. If you want the data still not to be NULL you should add a standard value for NULL elements from table

select case 
      when user_Name is null then "default value" 
      else user_name 
   end  

Upvotes: 1

Nikhil
Nikhil

Reputation: 3950

use:

-c -C65001 -t -r"\n" -T -S;

or:

  -k

Upvotes: 0

Related Questions