listDatabases now shows online databases only (#534)

This commit is contained in:
Aditya Bist
2017-10-27 16:10:38 -07:00
committed by GitHub
parent a2a392938e
commit 10cb78b712

View File

@@ -856,7 +856,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection
var systemDatabases = new[] {"master", "model", "msdb", "tempdb"};
using (DbCommand command = connection.CreateCommand())
{
command.CommandText = "SELECT name FROM sys.databases ORDER BY name ASC";
command.CommandText = @"SELECT name FROM sys.databases WHERE state_desc='ONLINE' ORDER BY name ASC";
command.CommandTimeout = 15;
command.CommandType = CommandType.Text;