Monitor Work from Home Employees with Employee Desktop Live Viewer.

Read More

Top Two Ways To Export Data From SQL Database To Excel

Siddharth Rawat
Siddharth Rawat Published On - 31 Jan 2020

“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?”

Queries like this are quite common, and many users are looking for ways to automate this process. SQL Server Management Studio (SSMS) is an excellent utility to configure, manage, and administer all components within Microsoft SQL Server. There are many advantages of having SQL data in spreadsheet programs like Excel. Spreadsheets are easy to use and flexible compared to SQL. So, many users frequently save essential SQL data to Excel to SQL. Now, we are going to discuss ways to export the SQL Server data to Excel. There are two manual ways that can be employed to achieve this task, which are 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.
  2. Click on Export Data

  3. 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.
  4. SQL Server Import and Export Wizard

  5. 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.
  6. Destination field

  7. At this point, you might encounter an error.
  8. To solve this issue in the search field, search for the 64-bit version of SQL Server Import and Export Data.
  9. SQL Server Import and Export Data

  10. 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.
  11. Next, select the source tables that you would like to export.
  12. select the source

  13. Click on the table and click on the Preview tab to view the table content. Click OK to exit.
  14. Click on the table

  15. In the Save and Run package window, make sure Run immediately is checked and then click Next.
  16. In Complete the Wizard window, click Finish.
  17. In the end, you will get a message of successful completion, as shown below:
  18. Next, go to the location where you have exported the SQL database table as an Excel file and open the Excel file.
  19. 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.
  3. click the Get Data icon

  4. Enter the name of your SQL Server in the text field and click OK.
  5. Enter the name of your SQL Server

  6. Select the appropriate option and click Connect.
  7. click Connect

  8. Click OK to proceed.
  9. In the Navigator window, select the database and then the table that you would like to import in Excel and click on Load.
  10. select the database

  11. Next, click on Close & Load icon.
  12. Click on Close & Load<

  13. Congratulations! You have successfully imported the SQL table into Excel.
  14. 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.