Here we learn how to import excel data into SQL server database, in this implementation guide we see example with importing an excel sheet, the same way we can import csv file in SQL database.
"Importing excel data to into sql table" is very useful for digital marketing, when you want to import all your social media contact details (like LinkedIn contact list, Gmail contacts etc) into your marketing database and then want to send them promotional emails.
Here we show how you can import excel data in SQL table and clean them in as per your need, you can easily remove duplicate data from your SQL table.
Step 1:
Login to your local SQL database, then follow the steps below
Right click on database => Tasks => Import Data
Then select the right excel version you want the data to be in
Make sure you check the checkbox “First row has column names”, this will help to understand the column name in SQL table
Select the destination, where you want to import the data, means your local database.
Select your server details.Then select SQL server authentication (strongly recommended), provide username and password
Once you provide right username and password, and then select the right database from dropdown list, click next.
Simply click the finish button to complete the data import.
You can see the preview by clicking on preview button,
At this point you also can change mapping, but better to organize and clean data in sql, we show you how!
Now at this stage, you have successfully completed the excel data import into SQL table, you simply can check by executing a select query on new table created (if you refresh your table list you will see one table is created with excel-sheet name)
Just think you have imported contact list from different type of excel sheet like LinkedIn, Gmail, Outlook etc, so there is another challenge to clean the data import them into your standard predefine table. Sometimes you may need to join two columns etc, remove null data etc.
select * from [tbTemp1] insert into [dbo].[tbTemp1] select ([first name] +' '+ [last name]) as fullName, [E-mail Address] as email, Company as organizaion from [dbo].[social$]
So far you have successfully imported data from excel data to SQL Database, but if you keep importing this way there may be many duplicate data in your table, so before you can use them for any type of business operation, you must know how to clean and remove all duplicate data from SQL table.
You may be interested in following post.