How to get database list using sql command> Below link more helpfull for get database list. https://www.simple-talk.com/sql/database-administration/exploring-your-sql-server-databases-with-t-sql/ 1. Basic Server Information -- Server and instance name Select @@SERVERNAME as [Server\Instance] ; -- SQL Server Version Select @@VERSION as SQLServerVersion ; -- SQL Server Instance Select @@ServiceName AS ServiceInstance ; -- Current Database Select DB_NAME () AS CurrentDB_Name ; -- Note the tempdb system database is recreated every time the server restarts -- Thus this is one method to tell when the database server was last restarted SELECT @@Servername AS ServerName , create_date AS ServerStarted , DATEDIFF ( s , ...