Results 1 to 3 of 3

Thread: like operator problem while upgrading from sql server 2000 to 2005

  1. #1

    Thread Starter
    Frenzied Member maged's Avatar
    Join Date
    Nov 2002
    Location
    Egypt
    Posts
    1,040

    like operator problem while upgrading from sql server 2000 to 2005

    Dear all,
    we have a query like this

    select * form clients where clientname like '%search%'

    please note that clientname column is nvarchar(200)

    some of the clients names rows are stored in arabic and some in english

    this query used to work well when running on sql server 2000 for both arabic and english search words

    when we moved the same database to sqlserver 2005

    only the queries with '%search%' in english returns results , if we try to search an arabic word or any arabic letter it doesnt return any rows.

    how can we solve this ? any ideas why is this happening ???

    it is supposed to be unicode column right ?

    thx in advance

  2. #2

    Thread Starter
    Frenzied Member maged's Avatar
    Join Date
    Nov 2002
    Location
    Egypt
    Posts
    1,040

    Re: like operator problem while upgrading from sql server 2000 to 2005

    anybody ?

  3. #3
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: like operator problem while upgrading from sql server 2000 to 2005

    The string value '%search%' is not unicode, for that you need to precede it with an N, eg:
    Code:
    select * form clients where clientname like N'%search%'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width