How to obtain query results in excel in SQL Server


In the course of the troubleshooting of a support case we may ask you to export the results of a query to Excel. This is how you perform this in Microsoft SQL Server using SQL Server Management Studio.

  1. Open SQL Server Management Studio and connect to the desired server
  2. Right click the desired database and select New Query
  3. Enter and execute the query ( F5 )
  4. In the results window, select all results ( Ctrl + A )
  5. Right Click the selection, Copy with Headers
  6. Open Excel
  7. Paste into the Excel worksheet
  8. Save the Excel file
Send us the resulting Excel file.

Best regards,
Ricardo Silva