Top Two Ways To Export Data From SQL Database To Excel

Siddharth Rawat
Siddharth Rawat | Updated On - 09 Apr 2021 |

Read time 8 min

SQL Server Management Studio (SSMS) is an excellent utility to configure, manage, and administer all Microsoft SQL Server components. There are many advantages of having SQL data in spreadsheet programs like Excel. Spreadsheets are easy to use and flexible compared to SQL. The novice users have a similar query on how they can export the SQL Database to an Excel file. Here is an example-

“I am new to SQL server database and looking for ways to export the database output to excel. I have a few database files that I urgently want to save to .xlsx or .csv. Can anyone with expertise please guide me on how to automate this process?”

Now, we are going to discuss ways to export the SQL Server data to Excel. Two manual methods can be employed to achieve this task, which is described below:

Method #1 Export from SQL Table to Excel Using the SQL Server Import and Export Wizard

There exists an inbuilt feature in SQL Server Management Studio (SSMS) to export data to Excel. The detailed steps are described below:

  1. Right-click on the database table that you would like to export. Under the Tasks, click on Export Data.
    Click on Export Data
  2. In SQL Server Import and Export Wizard, click Next. This will open up a new dialog window- Choose a Data Source. From the drop-down menu in Data sources, select SQL Server Native Client 11.0, then click Next.
    SQL Server Import and Export Wizard
  3. In the Destination field, choose Microsoft Excel. Next, in the Excel file path field, provide the location and filename by clicking on the Browse button. Click Next to proceed.
    Destination field
  4. At this point, you might encounter an error.
  5. To solve this issue in the search field, search for the 64-bit version of SQL Server Import and Export Data.
    SQL Server Import and Export Data
  6. Next, repeat steps 1-3. In the Specify Table Copy or Query window, select Copy data from one or more tables or views, and hit Next.
  7. Next, select the source tables that you would like to export.
    select the source
  8. Click on the table and click on the Preview tab to view the table content. Click OK to exit.
    Click on the table
  9. In the Save and Run package window, make sure Run immediately is checked and then click Next.
  10. In Complete the Wizard window, click Finish.
  11. In the end, you will get a message of successful completion, as shown below:
  12. Next, go to the location where you have exported the SQL database table as an Excel file and open the Excel file.
    go to the location

Method #2 Import from SQL Table to Excel Using Data Connection Wizard Dialog

Another easy way to export the SQL table to Excel is by exploiting the inbuilt Excel feature that enables us to import any SQL table. The detailed steps to do so are outlined below:

  1. Create a Blank worksheet and open it.
  2. On the Data tab, click the Get Data icon, select From Database > From SQL Server Database.
    click the Get Data icon
  3. Enter the name of your SQL Server in the text field and click OK.
    Enter the name of your SQL Server
  4. Select the appropriate option and click Connect.
    click Connect
  5. Click OK to proceed.
  6. In the Navigator window, select the database and then the table that you would like to import in Excel and click on Load.
    select the database
  7. Next, click on Close & Load icon.
    Click on Close & Load<
  8. Congratulations! You have successfully imported the SQL table into Excel.
    Successfully imported the SQL table into Excel

Kernel for SQL Database Recovery

Just like any other database file, SQL database files are also prone to database corruption. In gruesome scenarios like these, one should rely only on professional SQL database recovery tools such as Kernel for SQL Database Recovery Tool. It is a feature-rich tool that can quite quickly repair your earlier corrupt/inaccessible database files, irrespective of the server version. It is also possible to create a backup of the restored databases in script form.

Kernel for SQL Database Recovery

Conclusion

Many a time, it is easier to work with spreadsheets in comparison to SQL database tables. Therefore, it becomes necessary to export these SQL tables to Excel. In this post, we have explored two manual ways to achieve this task quickly. A damaged/ corrupted database file can hinder you from exporting from SQL to Excel; hence we recommend the user to rely on advanced SQL database recovery tools such as Kernel for SQL Database Recovery to repair corrupt SQL databases with ease.