Case sensitivity and database projects

2019-04-05 12:21发布

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条回答
看我几分像从前
2楼-- · 2019-04-05 13:05

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.

enter image description here

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:

enter image description here

查看更多
登录 后发表回答