sql server 2019 command line list databases code example Example: get database list in sql server SELECT name FROM master.dbo.sysdatabases