Home » Tips » How to Export Data from SQL Server to Excel Effortlesly

How to Export Data from SQL Server to Excel Effortlesly

author
Published By Siddharth Tehri
Aswin Vijayan
Approved By Aswin Vijayan
Published On January 22nd, 2024
Reading Time 3 Minutes Reading

In simple words, SQL is defined as a database management system that stores the DB in tabular form. This Defination generally results in another query which is “Is SQL Server similar to MS Excel?” and the answer to this is no.

Although Excel is one of the efficient ways to storing database in a tabular manner but it does not creates a relation between the tables. On the other hand, SQL Server is a relation database management system which makes it completely different Excel.

Although there is no technical reason why there would be requirement to export SQL data into Excel spreadsheet; there are scenarios when there is need to save SQL tables into Excel. Below given is a simple techniques exemplifying how the tables in SQL Server database can be exported to Excel.

Step 1: Create an Excel Sheet

The first step is to create an Excel spreadsheet to save the SQL table data. Add the fields that are in the table of SQL database.

Step 2: Start SQL Import-Export Wizard

The process to export the SQL data into Excel is accomplished by the Import and Export Wizard. To start it, follow the below mentioned steps:

In the Start menu, click on “All Programs”, choose “Microsoft SQL Server 2008” and select “Import and Export Data”.

sql-server

A welcome page will appear in screen. Click “Next” to proceed.

sql-wizard

 

Step 3: Choose a Data Source

In the “Data Source” box, there is a dropdown list using which you can select the source where the table to export is saved. Choose the default option “SQL Server Native Client 10.0”.

In the “Server Name” box, enter the name of Server where the table is saved.

Chose the authentication type in use. If it is SQL Server Authentication, provide username and password to login.

In the “Database” section, provide name of the database where the table to export is saved.

Click Next.

database

Step 4: Choose Spreadsheet Destination

In the “Destination” box, use the dropdown menu and select “Microsoft Excel”.

In the “Excel File Path” box, provide a location where the resultant Excel file should be saved.

In the “Excel Version” use the dropdown menu to select the Excel version.

Since the Excel file is created with first column, make sure that you select the check box for “First row has column names” enabled.

Click Next.

destination

Step 5: How to Copy SQL Data

The secure option here is “Copy data from one or more tables or views”. Select it and click Next.

copy-data

Step 6: Select Source Table

In the “Destination” box, enter name of the Excel spreadsheet that was created in Step 2.

To check out how the SQL table will appear in the Excel sheet, click “Preview”. Click Next to continue.

preview

Step 7: Run Package

The package is the settings that have been configured so far. If the licensed version is used, these settings ca be saved and reused. However, in the Express version which is free, the information has to be provided again and again.

save

complete-wizard

Step 8: Verification Step

Click on the “Report” button to check the information about the export process.

If there is an error that number of rows are incorrect, then check out that Excel spreadsheet is exactly same as the SQL table.

Click Close.

close

sqldatabase-on-excel