get all database names in sql server command code example Example: get database list in sql server SELECT name FROM master.dbo.sysdatabases