Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
icw
Constraint Violating Yak Guru
378 Posts |
Posted - 2007-07-07 : 01:47:54
|
| Hi I have two questions about case sensitivity;1. Do most people write their queries with UPPERCASE keywords or is that only for the textbooks. Personally I find it a hassle, My little finger aches because it is always on and off the SHIFT key2. I noticed that when I did the following query-----------------------------use AdventureWorksgoSelect * employee-----------------------------I get an 'invalid object' messageBut if I use;--------------------------use AdventureWorksgoSelect * Employee--------------------It works. SO obviously the query is case sensitive.Did this use to be the case with SQL 2000. I don't seem to remember having to be careful about case.THANKS |
|
|
sachinsamuel
Constraint Violating Yak Guru
383 Posts |
Posted - 2007-07-07 : 02:17:07
|
| 1. Do most people write their queries with UPPERCASE keywords or is that only for the textbooks. Personally I find it a hassle, My little finger aches because it is always on and off the SHIFT keyAnswer: Its a good practice to write queries in upper case, as if u follow this accross all your database objects then the code looks neat.I will give you a tip which I use. Write your sql statement/code in anycase and then select the code/statement and press Shift+Ctrl+u keys. All the code will be converted to uppercase. The reverse can be done by using Shift+Ctrl+l keys.Try and let me know incase you have any trouble.2. I noticed that when I did the following query-----------------------------use AdventureWorksgoSelect * employee-----------------------------I get an 'invalid object' messageBut if I use;--------------------------use AdventureWorksgoSelect * Employee--------------------It works. SO obviously the query is case sensitive.Did this use to be the case with SQL 2000. I don't seem to remember having to be careful about case.Answer: Its because your database collation is set to be case sensitive. You check the database collation setting by right clicking the database. Go general section and check the Maintainance sectionFor my user database I have set it to "SQL_Latin1_General_CP1_CI_AS". The character "CI" defines Case insensitive. I am sure this must be "CS" in your case. You can change this by alter database command. Please check the below url for the same.http://expertanswercenter.techtarget.com/eac/knowledgebaseAnswer/0,295199,sid63_gci1054949,00.htmlDon't sit back because of failure. It will come back to check if you still available. -- Binu |
 |
|
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2007-07-07 : 11:25:57
|
| Or you installed sql instance with case sensitive collation. How to write query depends on db object's collation. |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-07-07 : 16:45:05
|
| I think you should writeSelect * from EmployeenotSelect * EmployeePeter LarssonHelsingborg, Sweden |
 |
|
|
icw
Constraint Violating Yak Guru
378 Posts |
Posted - 2007-07-08 : 01:12:13
|
| Thanks a lot for the info.PS OI just copied the query wrong i did originally have "SELECT * FROM" |
 |
|
|
|
|
|