Case sensitivity and database projects

╄→尐↘猪︶ㄣ 提交于 2020-02-20 07:11:12

问题


I created a schema in our SQL Server 2012 database called [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]. 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'.

Is there a way to make the database project see a case change as a change, and update the database?


回答1:


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:



来源:https://stackoverflow.com/questions/17203916/case-sensitivity-and-database-projects

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!