Read time 8 minutes

SQL Server Management Studio (SSMS) is an excellent utility for configuring, managing, and administering all Microsoft SQL Server components. There are many advantages of having SQL data in spreadsheet programmes 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?”

Benefits of saving SQL database in an excel file

Although, the Excel file does not have the same protection level as the SQL Server, it has the essential advantages of a backup file. It can help you in the following situations-

  • If the user drops a column in a table by mistake, it can be recovered from the Excel file.
  • You can overcome hardware or media failure situations.
  • It can be used as a secondary backup file for several routine administrative needs and is valuable when a natural disaster hits the on-premises location.

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 the SQL table to Excel using the SQL Server Import and Export wizard

An in-built feature exists 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 built-in 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 and 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 tools such as Kernel for SQL Database Recovery. 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 times, 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 that the user rely on advanced tools to repair corrupt SQL databases with ease.

Kernel for SQL Database Recovery
Related Posts