T- Sql

  • Hi All,

    I came across a request to extract only those rows having Upper case in the feilds. For example

    create table #s (name varchar(20))

    Insert into #s values('RAMA'),('Krishna'),('ALLAH'),('buddha')

    I should be able to get only RAMA & ALLAH which has all upper case entries.

    Please anybody can send me the script or function which can get the results am looking for.

    Thanks for yor help in advance

  • How about this:

    SELECT *

    FROM #s

    WHERE name collate Latin1_General_BIN = upper([name])

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

  • Jeffrey Williams-493691 (1/27/2010)


    How about this:

    SELECT *

    FROM #s

    WHERE name collate Latin1_General_BIN = upper([name])

    Jeff is correct on this. This method works quite nicely for your requirements.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Thanks jeffery that worked.

Viewing 4 posts - 1 through 3 (of 3 total)

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