1

I have SSMS 2014 running with queries I am working on. When the computer got reset or when I kill SSMS, there are no autorecover files and when SSMS starts, it doesn't ask if I want to recover any files. I have autorecover set to save every minute. I have checked the paths mentioned here. I don't know why it's not working. Any free SSMS add-ons which provides this feature? (SSMS Tools Pack is not free)

enter image description here

Community
  • 1
  • 1
Tony_Henrich
  • 42,411
  • 75
  • 239
  • 374

2 Answers2

1

Using SSMS 2016 I found that the autorecover HAD saved my files - not sure of frequency or convinced by the coverage, but in my case it had saved what I wanted.

I found the location by nosing around in the registry, for me the location was stored in a key here:

HKEY_CURRENT_USER\SOFTWARE\Microsoft\SQL Server Management Studio\13.0\NewProjectDialog\MRUSettingsLocalProjectLocationEntries

My location was in My Documents\Visual Studio 2015, but I presume that will be different if you don't have VS installed!

Update:

There is a comment on this post which provides code to retrieve recently run queries.

TSQL: Get Last Queries Ran

SELECT deqs.last_execution_time AS [Time], dest.TEXT AS [Query]
FROM sys.dm_exec_query_stats AS deqs
CROSS APPLY sys.dm_exec_sql_text(deqs.sql_handle) AS dest
ORDER BY deqs.last_execution_time DESC

Works a treat and there is enough there for you to filter and find any lost queries, although this is obviously a last resort solution and best suited to recovery just after the loss. Also, the queries won't be preserved over a SQL server restart.

Community
  • 1
  • 1
The Gardener
  • 121
  • 1
  • 7
0

SSMS Tools Pack is pretty inexpensive so shouldn't be discounted. SSMSBoost is free and has a Recent Tabs feature.

Red Gate (who I work for) has SQL Prompt, which benefits from a Tab History feature. This is a commercial collection of a huge number of productivity features.

David Atkinson
  • 5,759
  • 2
  • 28
  • 35
  • SSBSBoost 'Recent tabs' feature didn't work. The history folder isn't even created. I will just assume now that SSMS 2014 support is not done yet (SSMS 2014 support is not advertised on their site). Someone asked about this this in their forum and they said they are working on it. SQL Prompt is way beyond my budget. I guess I'll just have to remember to hit 'Save All' more often – Tony_Henrich Jun 02 '14 at 22:26
  • Hi,this is SSMSBoost developer here ;) New version released (SSMSBoost 2.13), SSMS 2014 is now supported, all history features working: Editor contents history, script execution history, recent tabs, recent sessions (set of tabs), recent connections. – Andrei Rantsevich Jul 29 '14 at 02:21