Import Data From Excel File To SQL Server

SQl Server Management Studio (SSMS) provides functionality to import other data source files such as an excel file into your database. It is possible to copy excel file data through SQL Server in the form of table and you can process that data in your SQL Server.

How to Import Excel file into your database: I have an existing file on my desktop with name Data, with data in it.

  1. I have an existing file on my desktop with name Data, with data in it.

    1

  2. Create a new database or right click on an existing database: In this the excel file data will be imported, right click on database then Task, Now go to Import Data option and click on it. Here's the screenshot,

    2


  3. A new wizard will open: In this click Next:

    3


  4. In Data Source: Select data source as Microsoft Excel.

    4

  5. When you select excel a new window will be open select the path of data source file in it. After that click Next.

    5

  6. Now select Destination: Select SQL Server Native Client 11.0.

    6


  7. Now it will ask you for Selecting your database: Select desired database or select new one by clicking on New, then click Next.

    7


  8. In new window it will ask you about specific Table copy data, then click next.


    8

  9. In Source Table and Views: Select the sheet of excel which have data, you can preview its data by clicking on Preview option,


    9

    Or

    Click on Edit Mapping option in this you can see data size and Edit SQL option to view and change column values data types and possible to change order of columns to view. Now click on Ok and Next.

    10

  10. In Save and Run Package: Check the option Run immediately and click on Next.

    11

  11. In Complete the wizard: Click on Finish.

    12

  12. Click on Close in Success window.
           13


Now go to your database and Refresh it. You will see that your excel file is there in table form:

14

Now, you can further process this table data through SQl Server by applying queries on it.

Similar Articles