Skip to content

Commit

Permalink
No-op if engineedition is 6 or 11 due to lack of support for ASSEMBLY…
Browse files Browse the repository at this point in the history
…PROPERTY function

fixes #2588
  • Loading branch information
ErikEJ committed Jun 19, 2024
1 parent 55f48c5 commit 429d882
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@ private void addUDTsToDataTypesTable(DataTable dataTypesTable, SqlConnection con

SqlCommand engineEditionCommand = connection.CreateCommand();
engineEditionCommand.CommandText = "SELECT SERVERPROPERTY('EngineEdition');";
var engineEdition = (int)engineEditionCommand.ExecuteScalar()!;
var engineEdition = (int)engineEditionCommand.ExecuteScalar();

if (engineEdition == 9)
if (engineEdition is 6 or 9 or 11)
{
// Azure SQL Edge throws an exception when querying sys.assemblies
// Azure SQL Edge (9) throws an exception when querying sys.assemblies
// Azure Synapse Analytics (6) and Azure Synapse serverless SQL pool (11)
// do not support ASSEMBLYPROPERTY
return;
}

Expand Down

0 comments on commit 429d882

Please sign in to comment.