Last release note for Azure Data Studio was about the update the SQL Server Import extension that was moved to General Availability last month. From now on it is possible to import flat files like *.txt or *.csv into SQL table using Azure Data Studio.
Download a new version Azure Data Studio.
At first, I need to update my version of Azure Data Studio to the newest (version: 1.23.0), then I can install the extension. In Azure Data Studio in extension tab (on the left side), I need to find SQL Server Import, now I can install this extension.
How does import to SQL Server from Azure Data Studio works?
The SQL Server Import extension for Azure Data Studio supports importing CSV or TXT files into SQL Server. In order to use the Import Wizard (Ctrl+I), I need to have an active connection to a SQL Server instance.
To activate flat-file import I need to use the shortcut or right-click on a database and select Import wizard.
In the first step of the Import wizard, I need to specify my input file. I am choosing the server, database, location of my file and name of my table.
In the second step I can see preview of my importing file.
In the third step, I can modify column names, data type, choose a primary key or allow nulls. Then I can click Import Data.
In the fourth step I have a Summary and information about successful insert.
Now I can refresh my database in Azure Data Studio or in SQL Server to see a new table.
Thank you, Magda