You are currently viewing How to Export SQL Table Data to Excel (XLSX)

How to Export SQL Table Data to Excel (XLSX)

How to Export SQL Table Data to Excel (XLSX)

Step-I: Open SQL Server Management Studio and connect to SQL Server instance by clicking on the connect button.

Connect to SSMS

Step-II: Right click on database(NORTHWIND for this demo) from where you want to export table, move cursor to Tasks and click on Export Data… from the pop-up menu.

Step-III: SQL Server Import and Export Wizard will open, Click on Next button.

Step-IV:

  • Choose Data Source as SQL Server Native Client 11.0
  • Select Server Name.
  • To select Authentication, Either Select Use Windows Authentication or Use SQL Server Authentication radio button.
  • Select the Source Database from where you want to export table data.
  • Click on Next button.

Step-V:

  • Select Destination as Microsoft Excel to export in Text File.
  • Browse File name.
  • Excel version should be Microsoft Excel 2007 selected.
  • Check the checkbox First row has column names.
  • Click on Next button.

Step-VI:

  • Choose Copy data from one or more tables or views or write a query to specify the data to transfer.
  • Click on Next button.

Step-VII: If you check Write a query to specify the data to transfer radio button, then a new window will open where you write a query and click on Parse button to check the validity of query and click on Next button.

Step-VIII:

  • Select the table which you want to export, click on Preview button if you want to preview data before you proceed.
  • Click on Next button.

Step-IX: Check the Run Immediately check box and Click on Next button.

Step-X: There will be a Complete the Wizard window, where you verify the choices made in the wizard and Click on Finish button.

Step-XI: Process will be executed and completed successfully as shown in the following image, with the rows inserted. Click on Close button.

Step-XII: Check your XLSX Excel file where you exported data.

Leave a Reply