cancel
Showing results for 
Search instead for 
Did you mean: 

Problem: SQL Server table to CSV Pipeline -mis- translating BIT field to a true/false string value

bubba
New Contributor

Problem: SQL Server table to CSV file Pipeline -mis- translating BIT field to a true/false string value when writing to CSV.

Hi folks,

I’m dealing with a frustrating issue on Snaplogic: I need to go from a Sql server table from a db warehouse to a CSV file for import into a destination system that can only input CSV.

I have a basic 3 snap pipeline that works perfectly for this process, EXCEPT for Snaplogic auto-translating by default the Sql server BIT field to a “true”/”false” string value. This trips up the data import on the destination side.

I know that I can drop in a mapping snap and add a javascript ternary operator ($field == ‘true’ ? 1 : 0) , but then I’d need to map each and every field and pick out the bit fields for that processing. That would be time consuming and inefficient for this bulk data load operation across many tables. I’m trying to avoid that approach but can do if absolutely needed.

Have you encounter this issue of Snaplogic mis-translating the default bit field as true/false strings?

Any hints or assistance greatly appreciated!

According to the Snaplogic docs this is a known issues that was supposedly fix already:

July 2021 Bit is converted to 'true' and 'false'

May 2019 https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/797704281/May+2019+4.17+Release+Notes?show...

“Fixed an issue wherein bit data types in the SQL Server - Select table convert to true or false instead of 0 or 1.”

Details/examples of this issue:

The basic Pipeline:

image

Sql Server table source bit fields:
image

How the Pipeline writes the bit data field to the CSV file:
image

Thanks!

0 REPLIES 0