Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

SQL Question

  • 18-10-2000 02:27PM
    #1
    Registered Users, Registered Users 2 Posts: 2,494 ✭✭✭


    You want something like this

    select P.personal_id
    from personal P
    where UPPER(P.nickname) LIKE '%'+UPPER(@Name) +'%'

    The case sensetivity is a server setting and if you have your db server set to being cases sensitive you have to re-install it.

    Kayos

    The above applies to MS SQL Server (I dont really no about other servers)


Comments

  • Closed Accounts Posts: 20 The_Elf


    I have an sql query something like this

    select P.personal_id
    from personal P
    where P.nickname LIKE '%'+@Name+'%'

    so if @Name = 'lex'
    it returns Alex, Alexander etc etc....

    my question is it possible to make the search case insensitive so that it returns
    names entered as ALEX, AleXaNdEr

    i have no idea how to do this couldn't find anything on the web either


  • Registered Users, Registered Users 2 Posts: 380 ✭✭dogs


    I ran into a similar problem before. Turned
    out that if the value being searched for
    was mixed case, it was a case-sensitive
    search, but if it was all lower-case, it
    was a case-insensitive search. So a quick
    change of case before you query solved it
    for me. Bug / Feature ? I dunno, never
    did read the docs :)


Advertisement