如何将 SQL Server 2005 更改为区分大小写? [英] How do I change SQL Server 2005 to be case sensitive?
问题描述
我讨厌数据库中的区分大小写,但我正在为使用它的客户开发.如何在我的 SQL Server 上打开此选项,以确保我在所有查询中都得到了正确的案例?
I hate case sensitivity in databases, but I'm developing for a client who uses it. How can I turn on this option on my SQL Server, so I can be sure I've gotten the case right in all my queries?
推荐答案
怎么样:
ALTER DATABASE database_name COLLATE collation_name
请参阅 BOL 以获取整理选项列表 并选择最适合您需求的区分大小写的一个(即您的客户正在使用的那个).
显然,在尝试之前对数据库进行完整备份可能是个好主意.我个人从未尝试过使用与服务器默认排序规则不同的排序规则的数据库,所以我不知道任何问题".但是,如果您有良好的备份并在将其部署到您的客户之前在您的环境中对其进行测试,我无法想象其中会涉及多大风险.
See BOL for a list of collation options and pick the case-sensitive one that best fits your needs (i.e. the one your client is using).
Obviously, it's probably a good idea to make a full backup of your database before you try this. I've never personally tried to use a database with a different collation than the server's default collation, so I don't know of any "gotchas". But if you have good backups and test it in your environment before deploying it to your client, I can't imagine that there's much risk involved.
这篇关于如何将 SQL Server 2005 更改为区分大小写?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!