Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Case sensitivity and database projects

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?

like image 742
Craig Avatar asked Jun 20 '13 01:06

Craig


People also ask

What is case sensitive database?

Case sensitivity affects database object names and data. It can be set by using the installation time option or the database creation time option. Oracle. Case-sensitive. The case sensitivity affects data only and not database object names.

How do I make my database case sensitive?

SQL Server is, by default case insensitive; however, it is possible to create a case sensitive SQL Server database and even to make specific table columns case sensitive. The way to determine a database or database object is by checking its “COLLATION” property and look for “CI” or “CS” in the result.

Does SQL care about case sensitivity?

Keywords in SQL are case-insensitive for the most popular DBMSs. The computer doesn't care whether you write SELECT , select, or sELeCt ; so, in theory, you can write however you like.

Are database names case sensitive?

Database, table, table aliases and trigger names are affected by the systems case-sensitivity, while index, column, column aliases, stored routine and event names are never case sensitive. Log file group name are case sensitive.


1 Answers

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

like image 158
nathan_jr Avatar answered Nov 15 '22 23:11

nathan_jr