Recover SSMS Scripts

So you’ve been working on scripts in SSMS v17.x and suddenly it freezes and won’t let you interact with it at all.

No fear, when you close (kill) the SSMS process using Task Manager and reopen it you should be prompted to recover your files. The caveat being that you haven’t disabled Save AutoRecover in the Tools – Options menu item.

However, if you’d rather not take the risk of not being prompted and as per the previous screenshot, you should hopefully be able to find your scripts under your Documents\Visual Studio 2015 folder.

SSMS Drag/Drop Format Options

With the newly released SSMS v17.6 there has been a new Drag/Drop section added to Tools -> Options menu item as shown below:
 

 
When both are set to True you’ll get the existing functionality
 

 
When both are set to False you will now get:
 

 
Notice that the Database Version column will still have brackets as it has a space in the name even though Surround object names with brackets when dragged is set to False.

SQL Server Diagnostics intro

The newly released SQL Server Diagnostics (Preview) can be found here.
image1
Below are the install screenshots
image2image3image4image5image6
Once installed it is accessible via SSMS
image7
Dumps are usually located in your …MSSQLSERVER\MSSQL\Log folder.
Here I also selected to send an email just to see what it’ll look like.
image8
progressimage9
The email received was
image9_1
The other Diagnostics options were
image10
Looks a bit of a cover all at the moment
image11
image12
Takes you to the below site (which no longer exists)
image13

SSMS Include Client Statistics

Troubleshooting performance issues can be challenging and more so when 1 user has issues and another doesn’t for the same application and they both sit in the same room.
 
This is where SSMS Include Client Statistics may come in handy.
 
Enable the option and run the query causing issues on both users machines.
image1
Possibly you the results will help point you in the correct direction i.e. network path issues etc..
image2
Remember to unselect the option when finished as it adds extra overhead when used.

SSMS AutoRecover Location

By default, SSMS saves your queries every 5 minutes and keeps the info for 7 days.
 
I suspect this has saved many a DBA when unforeseen outages occur.
image1image2
One quick way to get to this recovery location is shown below and is by right clicking on a Query tab:
image3image4
As you may have noticed, this provides a quick access method to your hidden AppData folder.