diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectManagement/ObjectTypes/Database/DatabaseHandler.cs b/src/Microsoft.SqlTools.ServiceLayer/ObjectManagement/ObjectTypes/Database/DatabaseHandler.cs index 70aec2c3..6a8a31cf 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/ObjectManagement/ObjectTypes/Database/DatabaseHandler.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectManagement/ObjectTypes/Database/DatabaseHandler.cs @@ -479,9 +479,12 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectManagement // AutoCreateStatisticsIncremental can only be set when AutoCreateStatistics is enabled prototype.AutoCreateStatisticsIncremental = database.AutoCreateIncrementalStatistics; prototype.AutoCreateStatistics = database.AutoCreateStatistics; - prototype.AutoShrink= database.AutoShrink; + prototype.AutoShrink = database.AutoShrink; prototype.AutoUpdateStatistics = database.AutoUpdateStatistics; - prototype.RestrictAccess = database.RestrictAccess; + if (database.RestrictAccess != null) + { + prototype.RestrictAccess = database.RestrictAccess; + } if (prototype is DatabasePrototypeAzure dbAz) {