restore tabs after reopening SQL Server Management Studio

jdzmm42g  于 2023-10-15  发布在  SQL Server
关注(0)|答案(3)|浏览(113)

I don't suppose there's a way to emulate a FireFox-type of setup, whereby if I close SQL Server Management Studio (2008) my open tabs will be there again when I restart? I know I can save the individual windows into a .sql file but was wondering if there was a way for those tabs to reopen with the text in them on their own.

g6ll5ycj

g6ll5ycj1#

There is a built-in way to do mostly this, but it is not going to open any random tabs that were there when you closed SSMS.

You can create a Solution in SSMS and save it with any set of SQL scripts. This works much like Visual Studio. You can even save connections (server + login info). The FILE menu has options to "Close Solution" as well as "Open Project/Solution" and "Recent Projects and Solutions".

So, if you create a Solution, add some Queries (i.e. .sql scripts), and then close the solution either via the FILE menu or just closing SSMS, when you open that Solution again it will restore the tabs that you had open at the time the Solution / SSMS was closed.

I just tested this in SSMS 2012, though it might have started as far back as SQL Server 2005. Even if not in 2005, this feature should definitely be in 2008 / 2008 R2.

Not exactly as open-ended as the FireFox / Chrome feature as it requires a defined Solution with defined .sql files, but definitely close.

bgtovc5b

bgtovc5b2#

How about running the Studio inside a VMWare and simply suspend the VMWare between sessions?

For my development purposes I use a VMWare that only runs an instance of SQL Server and the Mangement Studio. Maybe it's overkill for DB development but it helps in testing the integration of the database into a networked environment.

jfewjypa

jfewjypa3#

Redgates SQLPrompt does exactly this. When you close you session (on purpose or if the session crashes), all previously open tabs will launch automatically when SSMS is reopened. If you choose not to automatically launch these tabs, they’re still available via the Tab History option.

The tool does cost money but the intellisense and Snippets feature that accompany it makes it value for money.

相关问题