mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-13 17:23:02 -05:00
Skip querying model database for Azure database prototypes. (#2095)
This commit is contained in:
@@ -1739,29 +1739,37 @@ WHERE do.database_id = @DbID
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
if (context.Server.DatabaseEngineType == DatabaseEngineType.SqlAzureDatabase)
|
||||
{
|
||||
// Azure instances don't have a model database we can query, so just use the defaults
|
||||
this.originalState = new DatabaseData(context);
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
//First try to get the properties, if attempt fails get
|
||||
//only the minimal set of properties by setting the DefaultInitFields value to false
|
||||
this.originalState = new DatabaseData(context, "model");
|
||||
try
|
||||
{
|
||||
//First try to get the properties, if attempt fails get
|
||||
//only the minimal set of properties by setting the DefaultInitFields value to false
|
||||
this.originalState = new DatabaseData(context, "model");
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
//Now try again with the optimized(DefaultInitFields set to false) properties
|
||||
context.Server.SetDefaultInitFields(typeof(Database), false);
|
||||
this.originalState = new DatabaseData(context, "model");
|
||||
//Set the DefaultInitFields to its original value
|
||||
context.Server.SetDefaultInitFields(typeof(Database), databaseDefaultInitFields);
|
||||
}
|
||||
this.originalState.owner = String.Empty;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
//Now try again with the optimized(DefaultInitFields set to false) properties
|
||||
context.Server.SetDefaultInitFields(typeof(Database), false);
|
||||
this.originalState = new DatabaseData(context, "model");
|
||||
//Set the DefaultInitFields to its original value
|
||||
context.Server.SetDefaultInitFields(typeof(Database), databaseDefaultInitFields);
|
||||
this.originalState = new DatabaseData(context);
|
||||
}
|
||||
this.originalState.owner = String.Empty;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
//Set the DefaultInitFields to its original value
|
||||
context.Server.SetDefaultInitFields(typeof(Database), databaseDefaultInitFields);
|
||||
this.originalState = new DatabaseData(context);
|
||||
}
|
||||
|
||||
// New database should not inherit ReadOnly from model database (Fix TFS 885072)
|
||||
|
||||
Reference in New Issue
Block a user