13

I'm a .NET developer and new to mac (m1 pro). I use docker and pull the azure-sql-edge image. When I try to create a table with a geometry column or insert a value in the geometry type column that was generated by code first solution, I encounter the error below:

Common Language Runtime(CLR) is not enabled on this instance.

I tried to enable CLR by running exec sp_configure 'clr enabled',1, but encountered the error below:

The specified option 'clr enabled' is not supported by this edition of SQL Server and cannot be changed using sp_configure.

What to do? Please help me.

2
  • Out of curiosity what tool are you using to query your db? I noticed sqlcmd isn't available on the ARM64 azure-sql-edge image. Commented Mar 18, 2022 at 15:42
  • 1
    I use vscode database extension Commented Mar 20, 2022 at 12:39

3 Answers 3

10

CLR-based functionality — whether it be the instance-level "CLR Integration" option (which enables custom / user-created assemblies); data types geometry, geography, and hierarchyid; built-in functions such as COMPRESS, DECOMPRESS, FORMAT, AT TIMEZONE; or a few other features — are not available in Azure SQL Edge. There is no way around this (at least not at this time). If any of this functionality is required, then using Azure SQL Edge as a platform is not an option. (Yeah, it kinda sucks, but that's how it goes.)

P.S. The CLR-based data types and built-in functions are not controlled via sp_configure 'clr enabled'. If they are available on the platform, then they cannot be disabled (outside of enabling fiber-mode / lightweight pooling, which is not something anyone should do).

Sign up to request clarification or add additional context in comments.

2 Comments

Oh, that's so bad. I hope the solution will be found soon.
Not unless the spatial types are reimplemented. SQL Server's relation to .NET is .... interesting.
1

A workaround for Mac Silicon users:

  1. Install Docker Desktop if you haven't already
  2. In settings -> general -> "Use Virtualization framework" should be checked
  3. In settings -> features in development -> "Use Rosetta for x86/amd64 emulation on Apple Silicon" should be checked
  4. Instead of using the Azure-SQL-Edge image, use the SQL2019 image. ie. Run from terminal: docker run --name SQLExpress2019 -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=yourStrong(!)Password" -e "MSSQL_PID=Express" -p 1433:1433 -d mcr.microsoft.com/mssql/server:2019-latest

NOTES:

  • Change password to something else.
  • Also could possibly try 2022 instead of 2019.
  • Express Edition is optional.
  • Docker will display an emulation warning, but it still works

2 Comments

Thank you, though I can't connect to Azure data studio
@EvidenceEkanem Make sure your connection in ADS has localhost as the server, and SQL Login as the authentication type. sa is the username and whatever password you used in the setup...
0

As suggested by others in the SQL2019 image CLR is supported

  1. Pull Command : docker pull mcr.microsoft.com/mssql/server:2019-latest
  2. docker run --cap-add SYS_PTRACE -e 'ACCEPT_EULA=1' -e 'MSSQL_SA_PASSWORD=yourStrong(!)Password' -p 1433:1433 --name azuresqledge -d mcr.microsoft.com/mssql/server:2019-latest

If this run command doesn't work(it definitely should though) then:

Docker website -> Search 'Azure SQL Edge' -> 'Azure SQL Edge' official from Microsoft -> Here you will find the run command.

Copy the command and make a change in the command i.e towards the end 'mcr.microsoft......' must be mentioned, replace it with 'mcr.microsoft.com/mssql/server:2019-latest'

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.