Recent Queries

Have you ever needed to write some SQL that's almost the same as a previous query, but the previous query has gone? How many times have you wished you could get it back?!

Unless you save every single modification of every single line of SQL you ever write, then it would be immensely useful to have access to recent queries you've executed.  TOAD has done this for years so I was very disappointed to discover that SQL Server 2005 didn't add this feature and distraught when I found that 2008 doesn't either.

I got so fed-up waiting I looked into writing an add-in to do this, but there's no support for SSMS add-ins in 2005 or 2008. People have done it but there's very little code or documentation out there.  I spoke to a friend at RedGate but he said they couldn't help me as they'd have to divulge what they consider their IP.

Looking on Connect I found a closed article referring to the feature as "T-SQL Recall", which was linked to a live article calling it "Query Execution History". This second one doesn't describe the requirement very clearly, but it boils down to the same thing. (If you can't see these articles then trying logging out of Connect - for some reason I could only read them when I wasn't logged in)

If you like the idea of a recent queries feature giving access to, say, the last 50 chunks of SQL you've executed, and allowing pasting into a query window, then please vote for it.

You might also want to vote for SSMS Add-In support while you're at it - wouldn't it be great if you could customise SSMS the same way you can customise Visual Studio?

-------------------- 

Updated:

Since writing this post I've built a Recent Queries add-in called Total SQL Recall.

If you're interested in writing an SSMS add-in then these may be of interest:

Published 01 September 2007 11:22 AM by jonsayce

Comments

# SimonS SQL Server Stuff said on 03 September, 2007 10:50 PM

Jon has posted a great summary of Addins in SSMS. Including many features you should consider voting

# SimonS' SQL Server Stuff said on 03 September, 2007 10:50 PM

My blog has moved to sqlblogcasts.com/blogs/simons

The full version of this post can be found here.,...

# omrbi said on 04 September, 2007 09:45 AM

Jon, this a real good idea, i vote for this.

Olivier

# Mladen said on 04 December, 2007 11:04 PM

You'll like this then:

http://weblogs.sqlteam.com/mladenp/archive/2007/09/20/SSMS-Tools-Pack---an-add-in-for-SQL-Management-Studio.aspx