Fix additional contained user/sqldb bugs (#1983)

This commit is contained in:
Karl Burtram
2023-04-03 19:26:53 -07:00
committed by GitHub
parent d9f473e604
commit 0b2eb26d45
2 changed files with 5 additions and 4 deletions

View File

@@ -132,8 +132,8 @@ namespace Microsoft.SqlTools.ServiceLayer.Security
} }
// Default language is only applicable for users inside a contained database. // Default language is only applicable for users inside a contained database.
if (parentDb.ContainmentType != ContainmentType.None if (LanguageUtils.IsDefaultLanguageSupported(dataContainer.Server)
&& LanguageUtils.IsDefaultLanguageSupported(dataContainer.Server)) && parentDb.ContainmentType != ContainmentType.None)
{ {
defaultLanguageAlias = LanguageUtils.GetLanguageAliasFromName( defaultLanguageAlias = LanguageUtils.GetLanguageAliasFromName(
existingUser.Parent.Parent, existingUser.Parent.Parent,

View File

@@ -870,8 +870,9 @@ namespace Microsoft.SqlTools.ServiceLayer.Security
{ {
get get
{ {
//Default Language was not supported before Denali. //Default Language was not supported before Denali or on SQL DB.
return SqlMgmtUtils.IsSql11OrLater(this.context.Server.ConnectionContext.ServerVersion); bool isSqlAzure = this.context.ServerConnection.DatabaseEngineType == DatabaseEngineType.SqlAzureDatabase;
return !isSqlAzure && SqlMgmtUtils.IsSql11OrLater(this.context.Server.ConnectionContext.ServerVersion);
} }
} }