Problem querying a CSV File with Synapse SQL Serverless Pool

Silvano Paxia 101 Reputation points
2020-12-07T17:24:07.48+00:00

Hello,

trying to query a very simple CSV file, Strings have Double quote (").

SELECT
    TOP 100 *
FROM
    OPENROWSET(
        BULK 'https://xxxx.dfs.core.windows.net/sample/csv/backlog-20201207-2.csv',
        FORMAT = 'CSV',
        PARSER_VERSION='2.0',
firstrow = 2,
FIELDQUOTE = '"'
) AS [result]

Keep getting this error:

Error handling external file: 'Quotes ' ' must be inside quoted fields at [byte: 206]. '. File: 'https://dfs.core.windows.net/sample/csv/backlog-20201207-2.csv'.

Any help?

thank you so much

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.
5,373 questions
0 comments No comments
{count} votes

6 answers

Sort by: Most helpful
  1. Frederico Camargo 1 Reputation point
    2021-03-23T15:16:37.78+00:00

    Then my last guess would be, in line with what I posted on my first post:

    "In the end, I noticed that the last two columns of my dataset, which came from an SAP table, were empty, and because the dataset uses the double quote as FIELDQUOTE it looked like this [""].
    I switched these empty fields to "NULL" and the query run with no errors."

    SAP databases use an empty string to represent NULL, have you checked whether your dataset has something like it?


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.