Import Flat File Structure Data to SQL Server using Azure Data Studio
Introduction
Azure Data Studio is a cross-platform database tool to develop and administer databases for data professionals using the Microsoft family of on-premises and cloud data platforms on Windows, MacOS, and Linux.
Previously released under the name of SQL Operations Studio, Azure Data Studio offers a modern editor experience for managing data across multiple sources with fast intellisense, code snippets, source control integration and an integrated terminal.
SQL Operations Studio was the preview name and preview version of Azure Data Studio. In September 2018, Microsoft changed the name to Azure Data Studio and released the General Availability (GA) version. Because SQL Operations Studio is no longer being updated or supported, it is recommended that SQL Operations Studio should download the latest version of Azure Data Studio to get the latest features, security updates, and fixes.
What are we going to do
SQL Server Management Studio (SSMS) is one swiss army knives in SQL Server DBA’s toolkit. It seamlessly imports data from flat file structures like CSV using the Flat File Import Wizard. We will see how we can do the same using Azure Data Studio.
Installation of Azure Data Studio
We can download the latest version of Azure Data Studio from here . Run the executable and to start the installer.
Clicking on install will start the installation.
Thus we have completed the installation of Azure Data Studio.
Connect to Database
Now lets see how we can connect to an existing Employee database using Azure Data Studio. Specify the server name and the Database name, click on Connect to establish the connection.
Thus we have made the connection to the database
Install SQL Server Import Plugin
Let’s install the SQL Server Import plugin that facilitates the import of csv or json files to SQL Server.
Click on Install to add the extension to Azure Data Studio.
Thus it has completed the installation of Flat file import service.
Import CSV file using Azure Data Studio
Lets try to import a sampe data from a csv file using Azure Data Studio
So as to import the data, right click the destination database and click on Import Wizard
This will open up the flat file import wizard. Input the source csv file from which we are importing the data.
Click on next and we can see the preview of the data that we are going to import
Clicking on Next will give us the option to edit the data type and modify the column information before we make the import.
Click on Import Data and we can see that the import process has been completed with the below success message.
Now if we query the EmployeeDetails table, we can see that the entire data has been imported from the CSV file .
Summary
Thus we have seen how to make use of Azure Data Studio to import data from a flat file structure to SQL Server