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

  • Here's a simple example that will render the result you want. Please note that this will only answer whether an A-Z character exists in the string (does not do anything for numbers or special characters in the string). There are other options such as using regexp within SQL Server for more customizable output.

    DECLARE

    @TestString VARCHAR(100)

    SET @TestString = 'Sarat'

    SELECT CASE WHEN BINARY_CHECKSUM(@TestString) = BINARY_CHECKSUM(LOWER(@TestString)) THEN 0 ELSE 1 END AS DoesContainUpperCase

    GO

    MJM