Issue with Decimal Data Type Missing Leading 0 before Decimal Point with bcp Export and a Fix


When you export data using bcp to a text file, decimal column with values less than 1  are loosing the leading 0 in the text file.

There is a workaround to fix this issue to use a varchar(20) in the place of decimal data type in a staging table or Convert/CAST the decimal data type to varchar(20) on the fly in the SELECT statement.

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