Case sensitivity and database projects

By | January 12, 2018

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?


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

Leave a Reply

Your email address will not be published. Required fields are marked *