Learn How to import and Export CSV file into SQL Server. Previously i posted about multiple tutorials on how to install SQL server on Windows. I also posted about the CRUD operations in SQL Server. Now I want to cover how one can import the data into the SQL Server.
Here the data happens to be CSV. The CSV file is basically Comma separated value file which contains the data specific to the typical data that you can manipulate into the excel spreadsheet. Considering the data that we happen to manipulate is going to be the tabular data.
So the goal of this tutorial is basically two things - First being able to import the data into the table in the SQL Server and Second being able to export the data outside the SQL Server table. This way things would be easier to manipulate add into the SQL Server and take out as required.
If you are interested in checking out the Video instructions, you should check out the video.
Your first step here is that you need the following things:
Once you have these three things the above video has the step by step instructions for you to import the data as a table into the SQL Server database. And the export for the same data can be done as well. I have covered that in the video too. So you may want to watch that till the end of the video.
You can import the data through multiple steps like by using the query and also using the wizard. Now the wizard method is lot easier and also good for validating and verifying the data being transferred. I'd recommend you to try that if you have plans to do this with your clients data.
Things to note in this case of the Import and Export.
SQL Server data tools make use of the SQL Server integration service to perform the copy and paste operation for the data transfer and also does the tabular data design internally. Which you can view in the wizard. Some of the time that would be easier to view and learn from as you do this multiple times.
Do note that SQL Server 2022 or maybe next year new version of SQL server may launch and so the tutorial may change a bit in terms of the instructions. So on that note we have to check out on how that would work around. A lot of interesting things may need to be watched out on that front.
If you happen to like this content, do give me feedback over there and that would help me improve my efforts in near future.