简体   繁体   English

区分大小写和数据库项目

[英]Case sensitivity and database projects

I created a schema in our SQL Server 2012 database called [Auth] . 我在SQL Server 2012数据库中创建了一个名为[Auth] Then tables and triggers were created as well. 然后也创建了表和触发器。 Later I was informed that the schema naming standard is lowercase, so it should be [auth] . 后来我被告知架构命名标准是小写的,所以它应该是[auth] I renamed the schema in the database project, and all related references. 我重命名了数据库项目中的模式,以及所有相关的引用。 However, the Schema Compare feature doesn't detect the difference, and isn't renaming the schema. 但是,架构比较功能不会检测到差异,也不会重命名架构。

This affects our Entity Framework objects, as they should be 'auth' . 这会影响我们的Entity Framework对象,因为它们应该'auth'

Is there a way to make the database project see a case change as a change, and update the database? 有没有办法让数据库项目将案例更改视为更改,并更新数据库?

There is an option in the project settings called "Validate Casing on Identifiers" which according to the documentation shall detect difference in case. 项目设置中有一个名为“验证标识符上的套管”的选项,根据文档,它将检测案例中的差异。 However, it only seems to be relevant if you select a case sensitive collation in the Database Settings of your project. 但是,如果在项目的“数据库设置”中选择区分大小写的排序规则,则似乎只有相关性。

在此输入图像描述

Once I selected SQL_Latin1_General_CP1_CS_AS I was able to detect the changes in a schema name and it scripts the DROP/CREATE schema as expected: 一旦我选择了SQL_Latin1_General_CP1_CS_AS,我就能够检测到模式名称中的更改,并按预期编写DROP / CREATE模式脚本:

在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM