gpt4 book ai didi

sql-server - 如果 sql server 的服务器排序规则区分大小写而数据库不区分大小写,那么查询是否区分大小写?

转载 作者:行者123 更新时间:2023-12-01 06:17:18 25 4
gpt4 key购买 nike

如果 sql server 的服务器排序规则区分大小写而数据库不区分大小写,那么查询是否区分大小写?我认为它应该基于数据库而不是服务器排序规则,但做了一个简短的测试似乎并非如此。有人确定吗?

最佳答案

嗯,我想 this解释一下:

The collation of an identifier depends on the level at which it is defined. Identifiers of instance-level objects, such as logins and database names, are assigned the default collation of the instance. Identifiers of objects within a database, such as tables, views, and column names, are assigned the default collation of the database. Variables, GOTO labels, temporary stored procedures, and temporary tables can be created when the connection context is associated with one database and then referenced when the context has been switched to another database. Therefore, the identifiers for variables, GOTO labels, and temporary tables are in the default collation of the instance.

这意味着即使在不区分大小写的排序规则中,变量(可能包括参数)也是区分大小写的。这就是我在测试中看到的情况:参数大小写有问题,但表/列名大小写没有问题。

关于sql-server - 如果 sql server 的服务器排序规则区分大小写而数据库不区分大小写,那么查询是否区分大小写?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1154175/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com