title: List names of all available MS SQL databases on server using python
body: <p>Trying to list the names of the databases on a remote MS SQL server using Python (Just like the Object Explorer in MS SQL Server Management Studio). </p>
  
  <p><strong>Current solution</strong>: The required query is <code>SELECT name FROM sys.databases;</code>. So current solution is using SQLAlchemy and Pandas, which works fine as below. </p>
  
  <pre><code>import pandas    
  from sqlalchemy import create_engine
  #database='master'
  engine = create_engine('mssql+pymssql://user:password@server:port/master')
  query = "select name FROM sys.databases;"
  data = pandas.read_sql(query, engine)
  </code></pre>
  
  <p>output: </p>
  
  <pre><code>                  name
  0               master
  1               tempdb
  2                model
  3                 msdb
  </code></pre>
  
  <p><strong>Question:</strong> How to list the names of the databases on the server using
  SQLAlchemy's <code>inspect(engine)</code> similar to listing table names under a database? Or any simpler way without importing Pandas? </p>
  
  <pre><code>from sqlalchemy import inspect
  
  #trial 1: with no database name
  engine = create_engine('mssql+pymssql://user:password@server:port')
  #this engine not have DB name
  inspector = inspect(engine)
  inspector.get_table_names() #returns []
  inspector.get_schema_names() #returns [u'dbo', u'guest',...,u'INFORMATION_SCHEMA']
  
  #trial 2: with database name 'master', same result
  engine = create_engine('mssql+pymssql://user:password@server:port/master')
  inspector = inspect(engine)
  inspector.get_table_names() #returns []
  inspector.get_schema_names() #returns [u'dbo', u'guest',...,u'INFORMATION_SCHEMA']
  </code></pre>