Posts
30
Comments
77
Trackbacks
0
SQL Server Management Studio crashed - recover unsaved sql query
If for some reasons SQL server instance dies or it crashes and if you had an unsaved query - you could still recover it from the backup files that sql server creates whenever it crashes unexpectedly.

The path for the backup .sql files is something like the following  -

C:\Users\USER_PROFI\Documents\SQL Server Management Studio\Backup Files\Solution1
posted on Thursday, February 28, 2013 5:31 PM Print
Comments
Gravatar
# re: SQL Server Management Studio crashed - recover unsaved sql query
spinxwebdesign
3/2/2013 10:54 AM
Yeah. Thanks for the information. I have carried out this to backup my data when my hard drive was crashed.
Gravatar
# re: SQL Server Management Studio crashed - recover unsaved sql query
Joe Smo
4/19/2013 8:04 PM
NOT ALWAYS TRUE - SQL Server Management Studio\ may or MAY NOT contain a "Backup Files\" deirectory
Gravatar
# re: SQL Server Management Studio crashed - recover unsaved sql query
Dev
2/4/2014 12:04 PM
Thanks a ton..it worked for me
Gravatar
# re: SQL Server Management Studio crashed - recover unsaved sql query
karthik
5/30/2014 10:57 AM
Thanks for the information.i could retrieve unsaved sql files, when my system was manually turned.
Gravatar
# re: SQL Server Management Studio crashed - recover unsaved sql query
somesh
7/5/2014 8:59 PM
Thank u very much
Gravatar
# re: SQL Server Management Studio crashed - recover unsaved sql query
somesh
7/5/2014 8:59 PM
Thank u very much
Gravatar
# re: SQL Server Management Studio crashed - recover unsaved sql query
Ashish M
7/25/2015 9:26 PM
use [databasename]

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
where
execquery.last_execution_time >= '2015-07-26 00:00:00.000'
and execsql.text like '%%'
ORDER BY execquery.last_execution_time DESC

===============
Works Like A CHARM !

Post Comment

Title *
Name *
Email
Comment *  
Verification