Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SSMS Auto-recovery/Auto-save new (unsaved) queries


SSMS Auto-recovery/Auto-save new (unsaved) queries

Author
Message
bochambers
bochambers
SSC-Enthusiastic
SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)

Group: General Forum Members
Points: 109 Visits: 82
Since upgrading from SQL Server Management Studio 2008 R2, I've noticed that it no longer autosaves queries that have not been manually saved first. If a file has been manually saved the autorecover files end up in the following directory:
%appdata%\Microsoft\SQL Server Management Studio\11.0\AutoRecoverDat\Solution1

However, I have ended up in the situation where I have unsaved queries when my computer has crashed and have not been able to recover them.
I have also found references to .sql files stored in temp files in the following directory, but the files here seem to be very haphazardly caught:
%userprofile%\AppData\Local\Temp

I have seen recommendations to use SSMS Tools but this has fairly significant licensing fees.
I'm currently testing out another add-in called SSMSBoost (under the community license), which has a lot of nice features and will probably solve my problem, but it seems crazy to need to use a third party add-in just to have some basic auto recovery features.

Does anyone have any other solutions?
ozkary
ozkary
Valued Member
Valued Member (63 reputation)Valued Member (63 reputation)Valued Member (63 reputation)Valued Member (63 reputation)Valued Member (63 reputation)Valued Member (63 reputation)Valued Member (63 reputation)Valued Member (63 reputation)

Group: General Forum Members
Points: 63 Visits: 141
This article points out the option to use the query statistic cache from SQL server. You can get the actual SQL using sys.dm_exec_sql_text.

Hope that helps:

http://ozkary.blogspot.com/2014/09/recover-sql-server-management-studio.html

http://ozkary.blogspot.com
http://og-bit.com
JasonClark
JasonClark
Old Hand
Old Hand (392 reputation)Old Hand (392 reputation)Old Hand (392 reputation)Old Hand (392 reputation)Old Hand (392 reputation)Old Hand (392 reputation)Old Hand (392 reputation)Old Hand (392 reputation)

Group: General Forum Members
Points: 392 Visits: 788
Upgraded versions like 2012, only saves recovery files for queries that has already saved earlier. Files that have not been saved seem to get dumped in the path c:\ users\yourname\appdata\local\temp
Or u can check on this path c:\ users\yourname\documents\sql server management studio

If u r unable to find them on disk u can recover queries from procedure cache as well if they aren’t pushed out from the cache memory.

Thanks
Andrew
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search