views:

28

answers:

1

I have a lot of sql server 2008 servers with many databases on each server. I usually forget which database is on which server. I want to create a batch file named after the name of the database that opens a connection to this database in the currently opened SSMS instance and not in a new instance.

A: 

I found a better solution than creating a batch file to handle my problem. I've registered all my database servers in the Registered Servers window under one Server Group and exported it to a file. When I need to connect to an instance of them in the Object Explorer I just double-click the instance in the Registered Servers window. When I need to write some sql code to be executed on an instance of them, I create a new Sql Server Scripts project, add my connections to the project and add sql files to write and save my daily scripts.

SubPortal