Send SQL Server query results as nicely formatted emails in Outlook
Posted by robkraft on February 4, 2012
I find myself sending the results of a lot of SQL queries I run in SQL Server Management Studio via e-mail to co-workers. The problem is, that the email content often looks terrible when I paste it into outlook from SQL Server Management Studio.
However, I have found that I can make it look better using the following steps.
- Run the query and let the output results go to grid (the default for most people).
- Right-click in the results and select ‘Copy with Headers’.
- Open Excel and paste the results.
- Click in the upper left corner of the Excel grid to select all rows and columns.
- Double-click between any two columns (A and B) to resize the widths of all columns.
- Select the “Center Text” alignment so that all column values are centered, rather than the default left-justified.
- Now copy all the contents of the Excel spreadsheet and paste the results into the body of your email in Outlook.
I find the results usually look pretty decent. Can you provide me a way to do this that is easier?