LIKE clause with matching case

  • Hi,

    does anybody know how I can build a WHERE field LIKE'a%' clause

    that will not return A.

    ie a WHERE clause that is case sensitive. I don't want to really

    change any collation or anything like that. I was wondering if there

    was an escape sequence or similar.

    I have heard that I need to do a CAST or CONVERT to binary and then

    compare the binary? How would this work?

    Thanks

    Charlie

  • you can still use a collate function in your where clause without Changing your table definitions.

    SELECT    mycolumn

    FROM      mytable

    WHERE     mycolumn COLLATE Latin1_General_CS_AS like  'a%'

    that is about the cleanest way to do it.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply