Home Forums SQL Server 2005 T-SQL (SS2K5) find whether a upper case letter is there in a given string RE: find whether a upper case letter is there in a given string

  • Cool solution Mark. Not one I would have thought of. I'd have done something like this:

    DECLARE @string VARCHAR(10)

    SET @string = 'Sarat'

    SELECT

    CASE

    WHEN @string LIKE '%s%' COLLATE Latin1_General_CS_AI THEN 'Lower Case s found'

    WHEN @string LIKE '%S%' COLLATE Latin1_General_CS_AI THEN 'Upper Case S found'

    ELSE 'No S found'

    END

    but I like yours better.