Free Web Development Online Tutorials, Learn to Code
Learn SQL Database Development, How to Import data from excel sheet to SQL database

Import Excel Data to SQL Table

Here you learn how to import excel data into SQL server database step by step implementation guide.

How to Import Excelsheet to SQL Database

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

import data from excel to sql

Step 2:
Select the data source type Microsoft Excel
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

import data from excel to sql

Step 3:
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.

import data from excel to sql

Step 4:
Check if all your excel data are imported properly.
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!

import data from excel to sql

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.

Here is an example of fetching data excelsheet table into new tempTable
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.

Import Excel Data to SQL Table

SQL job Interview Questions Answers

Course in Demand
MS SQL Examples | Join MS SQL Course