{"id":2173,"date":"2020-07-31T14:31:33","date_gmt":"2020-07-31T18:31:33","guid":{"rendered":"http:\/\/3.209.169.194\/blogs\/jonathan\/?p=2173"},"modified":"2020-07-31T14:31:33","modified_gmt":"2020-07-31T18:31:33","slug":"recovering-scripts-after-ssms-crash","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/recovering-scripts-after-ssms-crash\/","title":{"rendered":"Recovering Scripts After SSMS Crash"},"content":{"rendered":"<p>It happens to the best of us and this post is more of a reminder for myself the next time it happens to me than anything else.\u00a0 You are working in SQL Server Management Studio, you have a few tabs open (OK, it was 123 this time, but lets stay focused on the purpose of this blog post &#8211; You should see my Desktop and all the icons on top of other icons&#8230;), and then suddenly you get the dreaded SSMS has stopped responding\/crashed window.\u00a0 Sure you have been saving the important things along the way, but there are plenty of tabs that were just working queries for analysis that don&#8217;t really need to be saved but you still need them.\u00a0 What do you do?<\/p>\n<p>For a long time SQL Server Management Studio has been auto-saving scripts for you behind the scenes, and theoretically it should autorecover those scripts for you when it is launched again after the crash.\u00a0 However, I have experienced many situations where that didn&#8217;t happen.\u00a0 For a long time these backup files were located in the following path:<\/p>\n<p><strong><em>C:\\Users\\[User]\\Documents\\SQL Server Management Studio\\Backup Files\\[Solution]<\/em><\/strong><\/p>\n<p>However, during my recent crash of SSMS 18.5 I learned that this folder no longer exists&#8230;\u00a0 It turns out that the backup scripts are being saved still but to the following path:<\/p>\n<p><strong><em>C:\\Users\\[User]\\Documents\\Visual Studio 2017\\Backup Files\\[Solution]<\/em><\/strong><\/p>\n<p>Whew&#8230;. As a general practice, I copy the contents of that to a safe location before relaunching SSMS to make sure that anything that was auto-saved for me is safe and sound before SSMS has a chance to do anything.\u00a0 Call me paranoid, call me crazy, but it makes me feel safer when I open the application again and pray that it is going to work correctly and recover my unsaved work.<\/p>\n<p>Want to save yourself this headache entirely?\u00a0 SSMSToolsPack (<a href=\"https:\/\/www.ssmstoolspack.com\/\">https:\/\/www.ssmstoolspack.com\/<\/a>) has offered the ability to have a flight data recorder of all of your scripts and execution history with the <a href=\"https:\/\/www.ssmstoolspack.com\/Features?f=3\">SQL History<\/a> option.\u00a0 Oh sometimes I miss the days when I was a DBA and had just one environment that I worked in routinely that had all of my favorite tools and toys installed to protect me from myself.\u00a0 Live and learn (well I guess learning would imply that I wouldn&#8217;t keep having this repeat, so I will just live on and Google to find this post next time it happens)&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It happens to the best of us and this post is more of a reminder for myself the next time it happens to me than anything else.\u00a0 You are working in SQL Server Management Studio, you have a few tabs open (OK, it was 123 this time, but lets stay focused on the purpose of [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[56],"tags":[],"class_list":["post-2173","post","type-post","status-publish","format-standard","hentry","category-management-studio"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Recovering Scripts After SSMS Crash - Jonathan Kehayias<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlskills.com\/blogs\/jonathan\/recovering-scripts-after-ssms-crash\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Recovering Scripts After SSMS Crash - Jonathan Kehayias\" \/>\n<meta property=\"og:description\" content=\"It happens to the best of us and this post is more of a reminder for myself the next time it happens to me than anything else.\u00a0 You are working in SQL Server Management Studio, you have a few tabs open (OK, it was 123 this time, but lets stay focused on the purpose of [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/jonathan\/recovering-scripts-after-ssms-crash\/\" \/>\n<meta property=\"og:site_name\" content=\"Jonathan Kehayias\" \/>\n<meta property=\"article:published_time\" content=\"2020-07-31T18:31:33+00:00\" \/>\n<meta name=\"author\" content=\"Jonathan Kehayias\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jonathan Kehayias\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/recovering-scripts-after-ssms-crash\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/recovering-scripts-after-ssms-crash\\\/\"},\"author\":{\"name\":\"Jonathan Kehayias\",\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/#\\\/schema\\\/person\\\/01c10d94f3648654ef706d5e6305f69c\"},\"headline\":\"Recovering Scripts After SSMS Crash\",\"datePublished\":\"2020-07-31T18:31:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/recovering-scripts-after-ssms-crash\\\/\"},\"wordCount\":416,\"commentCount\":3,\"articleSection\":[\"Management Studio\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/recovering-scripts-after-ssms-crash\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/recovering-scripts-after-ssms-crash\\\/\",\"url\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/recovering-scripts-after-ssms-crash\\\/\",\"name\":\"Recovering Scripts After SSMS Crash - Jonathan Kehayias\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/#website\"},\"datePublished\":\"2020-07-31T18:31:33+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/#\\\/schema\\\/person\\\/01c10d94f3648654ef706d5e6305f69c\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/recovering-scripts-after-ssms-crash\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/recovering-scripts-after-ssms-crash\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/recovering-scripts-after-ssms-crash\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Management Studio\",\"item\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/category\\\/management-studio\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Recovering Scripts After SSMS Crash\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/#website\",\"url\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/\",\"name\":\"Jonathan Kehayias - The Rambling DBA\",\"description\":\"The Rambling DBA\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/#\\\/schema\\\/person\\\/01c10d94f3648654ef706d5e6305f69c\",\"name\":\"Jonathan Kehayias\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/86630e27f5deecc5c393ea57fc7c3b6a068949f4fd6b5309f81de5a276f12855?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/86630e27f5deecc5c393ea57fc7c3b6a068949f4fd6b5309f81de5a276f12855?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/86630e27f5deecc5c393ea57fc7c3b6a068949f4fd6b5309f81de5a276f12855?s=96&d=mm&r=g\",\"caption\":\"Jonathan Kehayias\"},\"sameAs\":[\"http:\\\/\\\/3.209.169.194\\\/blogs\\\/jonathan\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Recovering Scripts After SSMS Crash - Jonathan Kehayias","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/recovering-scripts-after-ssms-crash\/","og_locale":"en_US","og_type":"article","og_title":"Recovering Scripts After SSMS Crash - Jonathan Kehayias","og_description":"It happens to the best of us and this post is more of a reminder for myself the next time it happens to me than anything else.\u00a0 You are working in SQL Server Management Studio, you have a few tabs open (OK, it was 123 this time, but lets stay focused on the purpose of [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/recovering-scripts-after-ssms-crash\/","og_site_name":"Jonathan Kehayias","article_published_time":"2020-07-31T18:31:33+00:00","author":"Jonathan Kehayias","twitter_misc":{"Written by":"Jonathan Kehayias","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/recovering-scripts-after-ssms-crash\/#article","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/recovering-scripts-after-ssms-crash\/"},"author":{"name":"Jonathan Kehayias","@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/#\/schema\/person\/01c10d94f3648654ef706d5e6305f69c"},"headline":"Recovering Scripts After SSMS Crash","datePublished":"2020-07-31T18:31:33+00:00","mainEntityOfPage":{"@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/recovering-scripts-after-ssms-crash\/"},"wordCount":416,"commentCount":3,"articleSection":["Management Studio"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.sqlskills.com\/blogs\/jonathan\/recovering-scripts-after-ssms-crash\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/recovering-scripts-after-ssms-crash\/","url":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/recovering-scripts-after-ssms-crash\/","name":"Recovering Scripts After SSMS Crash - Jonathan Kehayias","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/#website"},"datePublished":"2020-07-31T18:31:33+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/#\/schema\/person\/01c10d94f3648654ef706d5e6305f69c"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/recovering-scripts-after-ssms-crash\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/jonathan\/recovering-scripts-after-ssms-crash\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/recovering-scripts-after-ssms-crash\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/"},{"@type":"ListItem","position":2,"name":"Management Studio","item":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/category\/management-studio\/"},{"@type":"ListItem","position":3,"name":"Recovering Scripts After SSMS Crash"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/#website","url":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/","name":"Jonathan Kehayias - The Rambling DBA","description":"The Rambling DBA","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/#\/schema\/person\/01c10d94f3648654ef706d5e6305f69c","name":"Jonathan Kehayias","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/86630e27f5deecc5c393ea57fc7c3b6a068949f4fd6b5309f81de5a276f12855?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/86630e27f5deecc5c393ea57fc7c3b6a068949f4fd6b5309f81de5a276f12855?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/86630e27f5deecc5c393ea57fc7c3b6a068949f4fd6b5309f81de5a276f12855?s=96&d=mm&r=g","caption":"Jonathan Kehayias"},"sameAs":["http:\/\/3.209.169.194\/blogs\/jonathan"]}]}},"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/posts\/2173","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/comments?post=2173"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/posts\/2173\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/media?parent=2173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/categories?post=2173"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/tags?post=2173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}