sql command to get the list of the database code example Example: get database list in sql server SELECT name FROM master.dbo.sysdatabases