Get list of Databases on 2 instances or more

  • How to get the list of databases on 2 instances on a server i.e the delault and a named instance ?

    sp_helpdb only gets me the db's on the instance I am connected to via SSMS ?

    :w00t:

  • I don't believe this is possible. You could however run the statement below using linked servers to connect to each of the servers, that could give you what you need:EXEC [MyServer].master..sp_MSForEachDB 'Use [?]; SELECT DB_NAME()'

    EXEC [MyServer\Instance].master..sp_MSForEachDB 'Use [?]; SELECT DB_NAME()'

    ______________________________________________________________________________Never argue with an idiot; Theyll drag you down to their level and beat you with experience

  • Also a Central Management Server will do the trick.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply