Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update SqlServerCodeFirst.cs #1889

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

nsnail
Copy link
Contributor

@nsnail nsnail commented Sep 20, 2024

解决唯一索引不可插入多个NULL的问题

解决唯一索引不可插入多个NULL的问题
@2881099
Copy link
Collaborator

2881099 commented Sep 20, 2024

这种写法,最低支持的sqlserver版本是多少,可以兼容一下。

@nsnail
Copy link
Contributor Author

nsnail commented Sep 20, 2024

在 SQL Server 中,可以创建非空唯一索引,以确保某列的值是唯一且不为 NULL。这个功能自 SQL Server 2008 版本起就已经支持。

这种写法,最低支持的sqlserver版本是多少,可以兼容一下。

在 SQL Server 中,可以创建非空唯一索引,以确保某列的值是唯一且不为 NULL。这个功能自 SQL Server 2008 版本起就已经支持。

@2881099
Copy link
Collaborator

2881099 commented Sep 20, 2024

可以加判断兼容 2005,如下:

if ((_commonUtils as SqlServerUtils).IsSqlServer2005)
原来的逻辑
else
新逻辑

虽然2005用的不多,但是兼容起来不算太麻烦。我们还提供了2000的访问方式。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants