Ad Code

How To Get Databases List from all the SQL Server

Get Databases List from all the MS SQL Server

You are supposed to get a list of all the databases on each SQL Server instance, along with their total number. All of your SQL Server instances are added to a server as connected servers.

 --Get list of existing databases

 Select name as DBName

 from sys.databases 

where name not in ('msdb','master','tempdb','msdb','model')





 


Post a Comment

0 Comments

Close Menu