Dumping information’s in SQL server management takes time while doing it manually and it could lead to human errors. We have lot of other alternative ways in SQL server management studio to ease this work, and one way to do this is to feed data from a plain text file to the SQL server. A comma- separated file is also called as CSV file stores all these information’s in a plain text from a tabular column’s. Each tabular column in the file makes search record and each record’s in the file contains unique fields which are separated by comma delimiter. To do this we don’t require installing any additional software.
Steps to feed the CSV file to the database
To import a comma separated file or CSV file using database, you should first create a table in the SQL server. Tables that are created is useful for importing CSV file.
Open the SQL studio and sign in using the right credentials and do a right click on the desired target database. You can right click on the whole DB, instead of table in the DB.
The wizard with introduction page will be opened. So, when page is opened simply proceed clicking on next. This screen is shown for selection of DS(data source) from the list that is shown. From this data source click on flat file which is shown as a drop down and click browse.
You will see an explorer that is opened out choose the CSV file from the given list, to ensure that you are selecting the file type to choose the file type as CSV
After selecting the designated file, please take few min to configure on importing the data inside DB by selecting the list of columns displayed before choosing next
After this is done, kindly review the columns you could see advanced options. This evaluation is needed before you import a CSV files.
If you find some character that is larger than fifty, request SQL for inspecting the columns in that file. This final assessment can be done by clicking on the Suggest type button in the SQL server. SQL servers are instructed only to examine the first hundred Rows. Error will be pointed during these examine process.
You could be redirected to one of the preview section in the DS (data source).
After you did the final evaluation on the preview section and if it is fine you can select the destination DB
In the step, you can select the destination DB. SQL will normally select the desired tables. Else if you are not satisfied, then you are required to create your own table or you would like to choose an alternate table that is shown in the DB then if you are fine click on the desired column in the DB
You must save it as a SSIS package. You can even leave by not choosing that option and proceed to next
You will see a verification screen. If it's fine, then you can import by clicking on the finish button