Redgate recently released SQL Prompt 7.1. I try to be an efficient developer (read: I’m a lazy and often impatient developer), so I’m a huge fan of any feature that can save me some clicks here and some time there. In this version, SQL Prompt comes with new Results Grid Features. And let me tell you… I rarely hear so many business users and business analysts ask me: How did you do that!?
Well, let me show you :)
Script as INSERT
This feature is available when you select the entire grid, adjacent rows, adjacent columns, a single cell, or a block of cells. Right-click and select Script as INSERT:
A new tab is automatically created with a script containing the values you selected. The script creates a temp table with the column names and data types from the original query, inserts the selected values, and drops the temp table. This is such a time-saver for me, even if I only need the INSERT part of the script :)
Open in Excel
This feature is available when you select the entire grid, adjacent rows, adjacent columns, a single cell, or a block of cells. Right-click and select Open in Excel:
This opens a new Excel file with the selected values and column names in the first row. This is perfect for when I quickly need to send some data to our business users:
P.S. Redgate has already made improvements to the Open in Excel feature in the SQL Prompt 7.2 Beta!
If you you don’t like the way the auto-generated code looks, just use SQL Prompt → Format SQL (CTRL+K, CTRL+Y) to make it pretty :)
Cathrine Wilhelmsen is a Microsoft Data Platform MVP, BimlHero Certified Expert, international speaker, author, blogger, and chronic volunteer. She loves data and coding, as well as teaching and sharing knowledge - oh, and sci-fi, chocolate, coffee, and cats :)