SQL Server – Enable Toolbox Window in SQL Server Management Studio

sql serversql server 2014ssms

I am assuming that the Toolbox windows in SSMS is used to store code samples. So I am able to highlight code in the editor and drag it to the Toolbox window.

However, if I wanted to use the code sample and drag it back onto the editor (or double click on it), I can't. All entries in the Toolbox are grayed out. And when I drag an entry, it turns the mouse cursor into a stop sign.

What do I need to do to enable this functionality?

enter image description here

I got those two entries there by highlighting some code in the editor, then dragging it to the area under Samples. First it shows up as actual text that you dragged. But you can right-click, select Rename and give it a friendly name.

Additional information:

  • Using SSMS v17.9.1 and the only add-in installed in SQL Prompt 8.

  • The only workaround that works is clicking on the entry, Ctrl+C, then pasting it into the editor.

  • To actually display Maintenance Plan Tasks, you have to right-click and select Show All.

Best Answer

After your updated comment, I believe my understanding is correct, that the Toolbox was only ever implemented to be used with the Maintenance Plan designer at this point. It's briefly mentioned in the Microsoft Books Online Use the Toolbox. My guess is they may have designed the Toolbox to be flexible should they implement it for other scenarios, but at this point I think Maintenance Plans is the only one, and I don't believe it's (natively) possible to enable it in other contexts of SSMS.

Sorry, that would've been cool. But something pretty similar to what you're trying to accomplish does exist in SSMS, called Code Snippets which that linked article goes through, and shows you how to customize with your own snippets via XML.