Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add "Available Databases" dropdown to custom toolbar in SSMS

I am creating my own custom toolbar in SSMS. I would like to add the "Available Databases" dropdown that is part of the SQL Editor toolbar to my custom toolbar. But I can't figure out how to add it. It does not appear to be in the command list.

like image 797
Adeel S Avatar asked Jun 22 '13 19:06

Adeel S


1 Answers

The only way I've been able to do this (using SSMS 2016) was by playing around with the .vssettings file directly. First I had to identify the GUID for the Available Databases command by removing it from the SQL Editor toolbar and exporting the settings. This added a <remove Cmd ...> entry to the settings file. Then I could use that GUID to add it to my custom toolbar as follows:

<Category name="Environment_CommandBars" Category="{B9D9C123-B500-4202-B887-57C829CBD08F}" Package="{DA9FB551-C724-11d0-AE1F-00A0C90FFFC3}" RegisteredName="Environment_CommandBars" PackageName="Visual Studio Environment Package">
  <CommandBars Version="05072811">
    <DefaultCustomizations/>
    <UserCustomizations>
      <add_group Group="{8D3759E8-C5F6-4C93-B672-43B89D8479A5}:00000202" GroupPri="40000001" Menu="{8D3759E8-C5F6-4C93-B672-43B89D8479A5}:00000602"/>
      <add_toolbar Menu="{8D3759E8-C5F6-4C93-B672-43B89D8479A5}:00000602" Name="Customer Toolbar" MenuType="toolbar"/>
      <modify_toolbar Menu="{8D3759E8-C5F6-4C93-B672-43B89D8479A5}:00000602" Name="Pleomax" Visibility="show" FullScreen="hide" Dock="top" Row="1" FloatRectangle="0,0,45,24" DockRectangle="1,0,45,24"/>
      <add Cmd="{52692960-56BC-4989-B5D3-94C47A513E8D}:00000004" CmdPri="40000001" Group="{8D3759E8-C5F6-4C93-B672-43B89D8479A5}:00000202" GroupPri="40000001" Menu="{8D3759E8-C5F6-4C93-B672-43B89D8479A5}:00000602"/>
    </UserCustomizations>
  </CommandBars>
</Category>

The key things to not change above are the Cmd="{...}" and CmdPri="...". The Group, GroupPri and Menu values should all match whatever is assigned when you create the custom toolbar (and export the settings).

Then when you import the modified settings file, it should have the Available Databases drop-down combo box in your customer toolbar!

like image 169
bmadtiger Avatar answered Oct 17 '22 01:10

bmadtiger