COPY INTO for Azure Synapse when column type is bit fails if csv file has 'true/false' or any number other than 1 or 0. Is there a way to avoid this error?

Promit Roy 11 Reputation points
2021-01-19T11:45:10.78+00:00

As per the question title, I'm trying to load some data from a csv file into Azure Synapse Analytics using the COPY INTO statement. My table has a bit column and my csv file has a 'true/false' at the index of this bit column, and my COPY INTO command keeps failing. So I've been trying with a few csv files, and anything that is not a 1/0 results in COPY failure.

Inserting through the online SQL editor works fine though.
INSERT INTO [dbo].[testtable] values (0)
INSERT INTO [dbo].[testtable] values (7)
INSERT INTO [dbo].[testtable] values ('true')

result in False,True,True being inserted into the table successfully.

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,402 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Saurabh Sharma 23,751 Reputation points Microsoft Employee
    2021-01-20T00:07:48.053+00:00

    @Promit Roy I have received information from products team that they are aware of this issue and actively working to rollout a fix for the same. Thanks for bringing this to our attention.

    Thanks
    Saurabh

    ----------

    Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.

    1 person found this answer helpful.

  2. billy.m 1 Reputation point
    2021-05-03T17:01:26.133+00:00

    I'm assuming this thread would be updated after the fix, as discussed above. But still wanted to double check if this is still on the radar. Encountering the exact same behavior as the OP.

    0 comments No comments