简体   繁体   中英

Case-sensitive database collation, but case-insensitive SQL queries

I'm running a project with SSIS and now creating new database with CS (case sensitive) collation, but all queries, stored procedures etc. were written in case-insensitive manner, so now SQL Server doesn't recognize them. I need to change table names, columns names... in queries in exact the same as they are in SQL Server.

Is it possible to have CS database with CI stored procedures, queries and so on... ?

No, case sensitivity at the database level applies to object names. You can, however, create a case insensitive database, and for each text column you create, modify the collation to a case sensitive one. I believe that that would give you the behaviour you ask for.

You can apply collation at the column-level. To do this, right click your table in SQL Server Management Studio, click 'Design' then select the column and in the Column Properties menu under the 'Table Designer' section you can choose to use something other than the database default.

Note, it will not let you change the collation on a column if its part of the primary key.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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