reading .csv from blobstorage container

arkiboys 9,686 Reputation points

There is a file, test.csv in the container.
In the synapse studio, I right click on this file which is in the blobstorage, and select the top 100 and it generates the automated sql to execute to read the data inside it.
When the automated openrowset query is executed, it does show the data but the csv headers are in the second row and in the first row I see C1, C2, C3, etc.
Do you know how to remove those unwanted C1, C2, C3, etc. headings?
Thank you

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,558 questions
0 comments No comments
{count} votes

Accepted answer
  1. Thomas Boersma 806 Reputation points

    Hi @arkiboys ,

    You need to specify that you want to use the csv headers as columns. Here is an example:

            BULK 'https://{your-storage-account-name}',  
            FORMAT = 'CSV',  
            HEADER_ROW = TRUE -- This the setting you want  
        ) AS [result]  

    See the docs for more info.

    Hope this helps.

    0 comments No comments

0 additional answers

Sort by: Most helpful