I have a sqlserver 2008 running with collation set to: Finnish_Swedish_CI_AS
I also have a table on that server with collation set to: SQL_Latin1_General_CP437_CS_AS
In the table I have a column named Material which contains
abcf
abcf
DF
SELECT Allowable FROM [Mat].[dbo].[D100601EN6115K3] WHERE Thickness = 2 AND CHARINDEX('F', Material)>0
It returns the allowable values for all three rows containing an “f” or “F”
How can I make my search case sensitive so that I only get the allowable from the last row?
I hope there is an easy way because I don’t want to set up the whole server again…
You use the COLLATE clause to change the collation of the expression
The COLLATE clause can go against a whole expression or just a column reference.
If Material already has the collation Material COLLATE SQL_Latin1_General_CP437_CS_AS then it should be
Sorry, it isn’t 100% clear which column is CS: Material or another one.
Basically,
'F'is the collation of the server or database if different