解析变量在 SQL 中的等于运算符错误中不兼容

dev*_*ull 8 python django sql-server-2012

我在 django 中收到以下错误model.objects.get_or_create

SQLServer [FreeTDS][SQL Server]The data types nvarchar(max) and ntext
are incompatible in the equal to operator.
Run Code Online (Sandbox Code Playgroud)

列 django 抱怨NVARCHAR(MAX)SQLServer 中允许为 null。

Django 模型元素定义为 TextField(null=True)

小智 0

也许 Sql-Server 正在将 Django TextField 转换为 nText 并尝试与 nVarChar 进行比较,就像这篇文章回答的那样。

/sf/answers/2727327431/