Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Unicode in SQL query

Unicode in SQL query

Scheduled Pinned Locked Moved Database
databasesql-serversysadminjsonhelp
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Varghese Paul M
    wrote on last edited by
    #1

    Hi friends, I am working with SQL Server 2005 database with Collation selected as Chinese_PRC_CI_AS I have a table DMASTER in the database with a field called DNAME of type VARCHAR(254) which contains some Chinese characters. When i run a query like select * from dmaster where DNAME = N'翻译文字或网页翻译文字或网页'; from the SQL Server 2005 client, it works fine. But if I try the same query programmatically using API "SQLExecDirect", it returns no records. May I know the problem and how to solve it. Thank you

    cheers Varghese Paul

    W 1 Reply Last reply
    0
    • V Varghese Paul M

      Hi friends, I am working with SQL Server 2005 database with Collation selected as Chinese_PRC_CI_AS I have a table DMASTER in the database with a field called DNAME of type VARCHAR(254) which contains some Chinese characters. When i run a query like select * from dmaster where DNAME = N'翻译文字或网页翻译文字或网页'; from the SQL Server 2005 client, it works fine. But if I try the same query programmatically using API "SQLExecDirect", it returns no records. May I know the problem and how to solve it. Thank you

      cheers Varghese Paul

      W Offline
      W Offline
      Wendelius
      wrote on last edited by
      #2

      Have you tried using SQLExecDirectW which is unicode version of the function. See: Unicode Function Arguments[^]

      The need to optimize rises from a bad design.My articles[^]

      V 1 Reply Last reply
      0
      • W Wendelius

        Have you tried using SQLExecDirectW which is unicode version of the function. See: Unicode Function Arguments[^]

        The need to optimize rises from a bad design.My articles[^]

        V Offline
        V Offline
        Varghese Paul M
        wrote on last edited by
        #3

        Thank you. It worked fine.

        cheers Varghese Paul

        W 1 Reply Last reply
        0
        • V Varghese Paul M

          Thank you. It worked fine.

          cheers Varghese Paul

          W Offline
          W Offline
          Wendelius
          wrote on last edited by
          #4

          You're welcome.

          The need to optimize rises from a bad design.My articles[^]

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups