Using SSMS Import Flat File Wizard with Azure Synapse

James H. Robinson 161 Reputation points
2020-10-21T15:33:01.703+00:00

I just want to load a simple CSV file into Azure Synapse. Is it possible to use the "Import Flat File Wizard" in SSMS to do that? If not, what is a quick way to import my small CSV?

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

Accepted answer
  1. HimanshuSinha-msft 19,471 Reputation points Microsoft Employee
    2020-10-21T19:41:02.87+00:00

    Hello @James H. Robinson ,

    Thanks for the ask and also using the Microsoft Q&A.

    I think the simplest way should be to use the COPY INTO command . You will have to create the table on the synapse before running this
    command .

    Step 1 . Upload the CSV file to storage location ( Azure Data Lake Storage (ADLS) Gen2 or Azure Blob Storage).
    Step 2 . Get the location ( see in the gif below )
    Step 3 . Get the access token . ( see in the gif below )

     COPY INTO dbo.emp   
     FROM 'https://storageaccount.blob.core.windows.net/yourcontainer/Folder1/emp.csv'  
     WITH (  
     FILE_TYPE='CSV',  
     CREDENTIAL=(IDENTITY= 'Storage Account Key', SECRET='AccessKey'),  
     FIRSTROW=2,  
     FIELDQUOTE = '"',  
     FIELDTERMINATOR=',',  
     MAXERRORS = 100  
     )  
    

    34153-1.png

    34154-2.png

    You can read more on the COPY INTO command here

    You can use ADF also do this .

    Thanks Himanshu
    Please do consider to click on "Accept Answer" and "Up-vote" on the post that helps you, as it can be beneficial to other community members

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

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.