Skip to content

Commit

Permalink
Skip UDT query on Azure SQL Edge (#2099)
Browse files Browse the repository at this point in the history
fixes #2086
  • Loading branch information
ErikEJ committed Aug 15, 2023
1 parent 3c83f6c commit 80905bd
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ private void addUDTsToDataTypesTable(DataTable dataTypesTable, SqlConnection con
return;
}

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

if (engineEdition == 9)
{
// Azure SQL Edge throws an exception when querying sys.assemblies
return;
}

// Execute the SELECT statement
SqlCommand command = connection.CreateCommand();
command.CommandText = sqlCommand;
Expand Down

0 comments on commit 80905bd

Please sign in to comment.