![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
No, keywords and variables are no case sensitive (but CLR method names are). -- Plamen Ratchev http://www.SQLStudio.com |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
My statement was incorrect about variables. Since they follow the rules for identifiers, they can be case sensitive depending on the collation. Here is from BOL: The collation of an identifier depends on the level at which it is defined. Identifiers of instance-level objects, such as logins and database names, are assigned the default collation of the instance. Identifiers of objects in a database, such as tables, views, and column names, are assigned the default collation of the database. For example, two tables with names that differ only in case can be created in a database that has case-sensitive collation, but cannot be created in a database that has case-insensitive collation. -- Plamen Ratchev http://www.SQLStudio.com |
#6
| |||
| |||
|
|
Now I have problem. I have database A and database B I made full backup of db A (example function "test" works properly Insensitive collation) And restore that backup in db B. In database B example "test" function doesn't work properly! I thought if I make full backup of db A and restore it in db B, db B must have exact collation like db A?! I suppose there isn't easy way to covert database collation? |
#7
| |||
| |||
|
|
m (miroslavsi (AT) gmail (DOT) com) writes: Now I have problem. I have database A and database B I made full backup of db A (example function "test" works properly Insensitive collation) And restore that backup in db B. In database B example "test" function doesn't work properly! I thought if I make full backup of db A and restore it in db B, db B must have exact collation like db A?! I suppose there isn't easy way to covert database collation? Are the databases on the same server or on different ones? If the servers are different, they may have different server collation. When you say "restore that backup in db B", this in accurate. More correctly is to say "restore that back *as* db B". Because, when you restore a backup into an existing database, everything in it is flattened. If you have further questions, please describe more closely what "doesn't work properly means". -- Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se Links for SQL Server Books Online: SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx |
#8
| |||
| |||
|
|
Databases are on different servers, and they have different server collation. "Doesn't work properly" means that given example function cannot be compiled in B database (has error, see posts before) while in database A compiles correctly (there are no errors) So we determined that is becouse different server collation. Question is what to do to avoid compilation errors in db B, but without changing sql function code, becouse code is encrypted. |
#9
| |||
| |||
|
|
m (miroslavsi (AT) gmail (DOT) com) writes: Databases are on different servers, and they have different server collation. "Doesn't work properly" means that given example function cannot be compiled in B database (has error, see posts before) while in database A compiles correctly (there are no errors) So we determined that is becouse different server collation. Question is what to do to avoid compilation errors in db B, but without changing sql function code, becouse code is encrypted. I'm afraid that you're stuck. That is, you either need to change the code, or change the server collation. Or give up the restore entirely. The recommendation I can give is to use a case-sensitive collation in development, and also stick to lowercase identifiers consistently to avoid problems like these. -- Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se Books Online for SQL Server 2005 at http://www.microsoft.com/technet/pro...ads/books.mspx Books Online for SQL Server 2000 at http://www.microsoft.com/sql/prodinf...ons/books.mspx |
#10
| |||
| |||
|
|
The recommendation I can give is to use a case-sensitive collation in development, and also stick to lowercase identifiers consistently to avoid problems like these. |
![]() |
| Thread Tools | |
| Display Modes | |
| |