|
I am new to SQL server 2000 and 2005. Can anyone tell me why I am getting wrong results while executing the following simple queries Case 1
Ans: 1 Case 2
Ans: 1 Case 3
Ans: 10 (Deleted "T" from the word "This" and got the Correct answer)
(comments are locked)
|
|
You need to specify the strings as unicode strings, and use a collation that is at least case and accent sensitive. I have chosen the most sensitive Latin1 code page available for this query:
The results from this query are:
Also, note that your case 3 answer was not correct - it was returning the index of the first 't'. Hi Matt,
Thank a lot for your Ans. It helped me a lot.
It worked fine without COLLATE Latin1_General_100_CS_AS_KS_WS).
But With COLLATE Latin1_General_100_CS_AS_KS_WS) i am getting invalid collation error. Please help
I am on SQL server 2005.
With regards
Novice
Nov 10 '09 at 12:19 AM
SQLserver_novice
On SQL Server 2005 you would most likely want to use the collation Latin1_General_CS_AS_KS_WS... You can always get a list of collations by using SELECT * FROM ::fn_helpcollations()
Nov 10 '09 at 12:50 PM
Matt Whitfield ♦♦
(comments are locked)
|

