-1

SSMS was working great until last night, and now it is not responding. In windows task manager it shows it is running, but when I click on it, it is not responding.

I have many unsaved SQL Query windows, and I don't want to lose them.

I tried using ALT + M and see if activity monitor is open and I also tried suggestions from https://sqlblog.org/2009/06/25/what-to-do-when-management-studio-hangs.

Any response is highly appreciated. I am using SQL server 2008 R2

Aaron Bertrand
  • 272,866
  • 37
  • 466
  • 490
Illuminati
  • 555
  • 2
  • 7
  • 34

1 Answers1

0

You can restart the ssms. The script below provides a list of query's and the time of execution in the last 24 hours. So you can recover your query's.... but works only for executed scripts.

Use <database>
SELECT execquery.last_execution_time AS [Date Time], execsql.text AS [Script] FROM sys.dm_exec_query_stats AS execquery
CROSS APPLY sys.dm_exec_sql_text(execquery.sql_handle) AS execsql
ORDER BY execquery.last_execution_time DESC
SnakeFoot
  • 174
  • 3
  • 16
  • dm_exec_query_stats contains plans that are in the cache. Once plan gets dropped from the cache it's gone and that depends on a lot of things, nothing to do with 24 hour limit. – James Z Mar 25 '16 at 16:54