Export SQL Tables To Excel File

This article is about exporting SQL Server table data into excel file sheet through Export Wizard.

SQl Server Management Studio (SSMS) provides functionality to export Database table data into excel file sheet. It is possible to save table data into an excel file through SQL Server using wizard.

First way: Very simple way is just select all results of any table by right click, select all, then again right click and select Copy with Headers and paste it in your excel sheet.

1


2


3

Second way:
To export data from one or multiple tables in either custom way or just export all data we have option in SQl Server Management Studio (SSMS): I have an existing database with tables into it.

  1. Right click on your database, then select Task and click on Export Data.

    4


  2. Click on Next in SQL Server Import and Export Wizard:

    5

  3. In Choose a Data Source: Select SQL Server Native Client 11.0 and click on Next.

    6

  4. In Data Source: Select your SQL Server login authentication and fill username and password. Now select your database and click Next.

    7

  5. In Choose a Destination: Select your desired destination, I am selecting Microsoft Excel and click Next.

    8

  6. In Destination: Select your destination file from location and click on Next:

    9


  7. Select Table Copy and click on Next:

    10


  8. Select the source tables for export, you can do mapping by clicking on Edit Mapping option, and you can click on Edit SQL to change order or datatype of table. Click Next.

    11

  9. In Review Data Type Mapping you have option to check or uncheck use global datatypes, if fail error is showing you can change it to ignore by selecting On Error option, Click on Next.

    12

  10. In Save and Run Package: Select Run Immediately and click Next:

    13

  11. Execution Status: Execution successful, click Close.
          14


Now open your excel file in which tables were exported, I had saved the records into Data file:

16

You can see both the tables (Product1 and Trainee1), the selected values from my database are exported into Data excel format file within 2 sheets.