bcp to Export Empty String to NUL in Text File (Casuses issues to work with other systems)


When you export data with bcp command, you may see some NUL value in the place of empty string. The workaround is to use NULL in TSQL to replace empty string with NULL by using NULLIF function.

Found the discussion here:

How to make Microsoft BCP export empty string instead of a NUL char?
http://stackoverflow.com/questions/12588149/how-to-make-microsoft-bcp-export-empty-string-instead-of-a-nul-char

Advertisements


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s