Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to have SSMS open a certain connections every time I open it up?

Every night the university reboots every machine in my department at midnight and I help my professor with various projects on 11 different sql servers. Since i do not own a personal computer i can't just leave SSMS open over night.

Is it possible to have a setting or some featured enabled so that it remembers to open the connections that i tell it to when i open SSMS?

Thank you.

like image 450
some_bloody_fool Avatar asked Jan 10 '12 16:01

some_bloody_fool


2 Answers

You can call SSMS from the command line and uses switches to do what you're trying to do.

There are -S -d -U and -P switches for server, database, username, and password. You should be able to put the call into a .bat file and use that easily enough.

There is documentation on the Microsoft website.

like image 150
Tom H Avatar answered Sep 22 '22 01:09

Tom H


If you are allowed to install third party software the SSMS Tools Pack addin does what you need.

... You can also Restore Last Session by pressing the button on toolbar. This opens the last saved tabs already connected to the server they were connected to before...

like image 44
Martin Smith Avatar answered Sep 25 '22 01:09

Martin Smith