我正在使用正在处理的查询运行 SSMS 2014。当计算机重置或我杀死 SSMS 时,没有自动恢复文件,当 SSMS 启动时,它不会询问我是否要恢复任何文件。我将自动恢复设置为每分钟保存一次。我已经检查了这里提到的路径。我不知道为什么它不起作用。任何提供此功能的免费 SSMS 插件?(SSMS 工具包不是免费的)
2 回答
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.
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.
SSMS 工具包非常便宜,因此不应打折。SSMSBoost 是免费的,并且具有最近的标签功能。
Red Gate(我为之工作)有SQL Prompt,它受益于Tab History 功能。这是一个包含大量生产力功能的商业集合。