指定的选项“clr启用” Azure SQL Edge 不支持

发布于 2025-01-15 04:05:02 字数 432 浏览 4 评论 0原文

我是一名 .NET 开发人员,也是 mac (m1 pro) 的新手。我使用 docker 并提取 azure-sql-edge 映像。当我尝试创建包含 geometry 列的表或在代码优先解决方案生成的 geometry 类型列中插入值时,遇到以下错误:

此实例上未启用公共语言运行时 (CLR)。

我尝试通过运行 exec sp_configure 'clrenabled',1 来启用 CLR,但遇到以下错误:

此版本不支持指定的选项“clrenabled” SQL Server 且无法使用 sp_configure 进行更改。

该怎么办?请帮我。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

嘿看小鸭子会跑 2025-01-22 04:05:03

基于 CLR 的功能 — 是否是实例级“CLR 集成”选项(支持自定义/用户创建的程序集);数据类型geometrygeographyhierarchyid;内置函数,例如COMPRESSDECOMPRESSFORMATAT TIMEZONE;或一些其他功能 - 在 Azure SQL Edge 中不可用。没有办法解决这个问题(至少目前没有)。如果需要任何此功能,则不能选择使用 Azure SQL Edge 作为平台。 (是的,这有点糟糕,但事情就是这样。)

PS 基于 CLR 的数据类型和内置函数通过 sp_configure 'clrenabled' 控制。如果它们在平台上可用,则无法禁用它们(除了启用光纤模式/轻量级池之外,这不是任何人都应该做的事情)。

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).

匿名。 2025-01-22 04:05:03

Mac Silicon 用户的解决方法:

  1. 如果尚未安装 Docker Desktop,请
  2. 在设置 -> 中安装 Docker Desktop。一般-> 选中“使用虚拟化框架”
  3. 应在设置 -> 中 开发中的功能 ->应选中“在 Apple Silicon 上使用 Rosetta 进行 x86/amd64 模拟”,
  4. 而不是使用 Azure-SQL-Edge 映像,而是使用 SQL2019 映像。 IE。从终端运行: 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

注意:

  • 将密码更改为其他内容。
  • 也可以尝试 2022 年而不是 2019 年
  • 。 Express 版是可选的。
  • Docker 将显示仿真警告,但它仍然有效

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
挽清梦 2025-01-22 04:05:03

正如 SQL2019 映像中其他人所建议的,CLR 支持

  1. Pull 命令: 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 (!)密码'-p 1433:1433 --name azuresqledge -d mcr.microsoft.com/mssql/server:2019-latest

如果此运行命令不起作用(当然应该如此),那么:

Docker website ->搜索“Azure SQL Edge”-> Microsoft 的“Azure SQL Edge”官方 ->在这里您将找到运行命令。

复制命令并在命令中进行更改,即必须提及末尾“mcr.microsoft......”,将其替换为“mcr.microsoft.com/mssql/server:2019-latest”

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'

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文