On April 1 SQL Server 2016 Release Candidate 2 was released along with the SQL Server Management Studio March 2016 preview refresh v13.0.13000.55. This new version of SSMS uses the Visual Studio 2015 Isolated shell and doesn’t allow any 3rd party extensions like Tabs Studio.
Update (May 10, 2016): Thanks to Karl Burtram from Microsoft, Tabs Studio is now in the SSMS 2016 package load inclusion list.
Many automatically opened SQL tabs in SQL Server Management Studio have names like SQLQuery1.sql, SQLQuery2.sql etc:
SQLQuery tabs in SSMS 2012
To better distinguish such tabs I’ve created the SQLComment add-in that can add a comment from the query body to the tab name:
Tabs with comments in SSMS 2012
You can chose any comment format and configure SQLComment to extract it using a .NET regular expression. For example, the default regex
StoredProcedure \[dbo\]\.\[(?<M>\w+)\] extracts the procedure name (AddEvent) to the M named group from the following code:
/****** Object: StoredProcedure [dbo].[AddEvent] Script Date: 3/11/2014 8:29:10 AM ******/
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
To extract description from a comment like ––– provides details on investors you can use the regex ^––– (?<M>.+)$. To support several formats you can combine regexes with ‘|’ like ^––– (?<M>.+)$|StoredProcedure \[dbo\]\.\[(?<M>\w+)\]. You can use several separate M groups (line Name and Ext in standard tab grouping), the resulting string will be concatenated from all captures. Only tabs starting with SQLQueryNN.sql are considered for commenting.
Download link: SQLComment v1.0.0.
Update (March 20): Added commenting support for grouped tabs SQLComment v1.0.1.
Update (October 23): Added the “Set SQL comment…” tab context menu command for temporary comments. Added more customization for displaying comments. SQLComment v1.0.4.
Comments Off on Add an SQL query description to the SSMS tab name with the SQLComment add-in
SQL Server 2012 was released about a month ago:
SQL Server 2012 Management Studio splash screen
The new management studio uses Visual Studio 2010 shell. Extensibility for SSMS 2012 is still not officially supported by Microsoft, but luckily Visual Studio add-ins work just fine in it. Unfortunately, Visual Studio extensions don’t work as ssms.exe contains white list of allowed package GUIDs. I had to change my Visual Studio 2010 helper extension to helper add-in and after that Tabs Studio works without problems in the new IDE:
Tabs Studio in SSMS 2012
Download link: Tabs Studio v2.7.0.
Comments Off on SQL Server 2012 Management Studio support
If you start SSMS as administrator on a Windows 7 machine with UAC on, you get the Class not registered error number 80040154 for the TabsStudio.Connect class:
Running SQL Server Management Studio as administrator
Class not registered error 80040154 in SSMS
Tabs Studio installation for SSMS includes registration of the TabsStudio.Connect class for the current user. On a Windows 7 machine with UAC enabled, elevated applications (in this case SSMS running as admin) don’t see registered per-user COM classes (see Per-User COM Registrations and Elevated Processes with UAC on Windows Vista SP1 for more details). I can’t add per-machine TabsStudio.Connect registration to the installer because it runs without admin rights. A workaround is to register TabsStudio.Connect per-machine manually, double clicking a registration file I’ve prepared.
SSMS is a 32-bit application. Running on 32-bit Windows it uses per-machine COM registration from HKEY_LOCAL_MACHINE\Software\Classes\CLSID, on 64-bit Windows – HKEY_LOCAL_MACHINE\Software\Classes\WOW6432node\CLSID (see Registry changes in x64-based versions of Windows Server 2003 and in Windows XP Professional x64 Edition). I’ve prepared two registration files – one for 64-bit Windows and one for 32-bit Windows.
Note that after unsuccessful loading SSMS disables Tabs Studio and doesn’t try to load again on a next start. To enable Tabs Studio startup loading you can reinstall Tabs Studio or change HKCU\Software\Microsoft\Microsoft SQL Server\100\Tools\Shell\Addins\TabsStudio.Connect\LoadBehavior from 0 to 3.
Download links for per-machine TabsStudio.Connect class registration: SSMS on Windows 32-bit, SSMS on Windows 64-bit.
Comments Off on Running SQL Server Management Studio as administrator
The most frequent support question I receive is how to work with tabs in SQL Server Management Studio. To improve the first impression for Tabs Studio in SSMS, I’ve decided to disable default SSMS tab grouping:
No tab grouping in SSMS by default
If you want tab grouping, two sample expressions equal to the default regex in previous releases are readily available:
SSMS tab grouping snippets
Comments Off on No default SSMS tab grouping
SQL Server Management Studio adds the [ReadOnly] prefix to the window title for read only scripts. It also adds Debugging… and Executing… suffixes when SQL scripts are debugged and executed:
Read only, debugging and executing tabs in SSMS 2008
I’ve added additional processing for such titles that removes excessive text and adds appropriate status icons:
Updated tabs view
Comments Off on Special tab titles in SSMS
Microsoft SQL Server Management Studio 2008 has several built in tab text options:
Tab text options in SSMS 2008
You can shorten tabs by omitting parts like server name or login name – SQLQuery1.sql was created with default settings, SQLQuery3.sql was created with database, login and server names off. These options don’t exist in SSMS 2005.
SQL Server Management Studio uses quite different scheme for tab names from Visual Studio. Here is the screenshot of default tab names (I temporarily configured Tabs Studio to not group tabs):
No tab grouping
I’ve significantly improved SSMS support in the next Tabs Studio version:
1. Separate settings for SSMS.
Now SSMS 2005/2008, VS 2005/2008 and VS 2010 have separate settings. You can customize each of the three product lines independently.
2. Remove path from tab name works for SSMS.
Turning on the Remove path from tab name option strips parentheses and removes path from tab names in SSMS now:
Remove path from tab name in action
3. Special title grouping rules for SSMS out of the box.
Tabs Studio now uses new default title grouping rules when running in SSMS that both group tabs and strip parentheses:
Tab grouping (default)
4. Support for SSMS table paths.
Documents representing tables in SSMS have document paths like “Server[@Name=’COMP1′]/Database[@Name=’ReportServer’]/Table[@Name=’ActiveSubscriptions’ and @Schema=’dbo’]”. Tabs Studio now applies path grouping rules to these paths as well.
Update: Tabs Studio v1.7.9 with these changes is ready for download.
Comments Off on SSMS tab grouping
I’ve added Tabs Studio registration with SQL Server Management Studio 2008 to the Tabs Studio installer. There will be no need to manually setup and run the .reg file any more.
Comments Off on Automatic SSMS registration
“SQL Server Management Studio is an integrated environment for accessing, configuring, managing, administering, and developing all components of SQL Server.” It uses the same Visual Studio shell as Visual Studio and after making some small changes I was able to use Tabs Studio tabs in SSMS IDE. I verified that Tabs Studio integration with SSMS works on the computer with SQL Server 2008 Enterprise or Developer edition:
1. Install Tabs Studio v1.6.4
If Tabs Studio installer fails to find Visual Studio, create the Visual Studio 2008 folder in your Documents folder.
2. Register Tabs Studio for SSMS
- Download the TabsStudioSSMS_100.reg file.
- Modify path to TabsStudio.dll in this file in two places according to your settings. E.g. change C:\\Documents and Settings\\Administrator\\My Documents\\Visual Studio 2008\\Addins\\TabsStudio.dll to C:\\Users\\me\\Documents\\Visual Studio 2008\\Addins\\TabsStudio.dll.
- Run modified TabsStudioSSMS_100.reg (admin rights are not required, all settings are for the current user).
3. Run SQL Server Management Studio
Tabs Studio tabs in Microsoft SQL Server Management Studio
To disable Tabs Studio in SSMS change LoadBehavior
to 0 in the reg
file or directly in the registry.
I’m not a regular SSMS user. Please let me know if Tabs Studio behaves not as expected in SSMS IDE.