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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. problem in hyphen character in string search in SQL server

problem in hyphen character in string search in SQL server

Scheduled Pinned Locked Moved C / C++ / MFC
databasesql-serversysadminalgorithmshelp
4 Posts 3 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.
  • H Offline
    H Offline
    hvgyufg28fh38tyr78hf
    wrote on last edited by
    #1

    Hai all, I am searching one string (ex.Hello-Welcome) in text file using SQL query. its searching Hello and Welcome seperatly and giving a result , i think bcoz hyphen(-) is a word breaker in SQL .can any one give me the idea how to resolve the problem. i need to use hyphen in searching string, and i need a combined string search result. thanks mahe

    L CPalliniC 2 Replies Last reply
    0
    • H hvgyufg28fh38tyr78hf

      Hai all, I am searching one string (ex.Hello-Welcome) in text file using SQL query. its searching Hello and Welcome seperatly and giving a result , i think bcoz hyphen(-) is a word breaker in SQL .can any one give me the idea how to resolve the problem. i need to use hyphen in searching string, and i need a combined string search result. thanks mahe

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      This does not appear to be a C++ question. You may get better visibility by posting in the General Database forum.

      H 1 Reply Last reply
      0
      • L Lost User

        This does not appear to be a C++ question. You may get better visibility by posting in the General Database forum.

        H Offline
        H Offline
        hvgyufg28fh38tyr78hf
        wrote on last edited by
        #3

        thanks if u have any idea pls let me know.

        1 Reply Last reply
        0
        • H hvgyufg28fh38tyr78hf

          Hai all, I am searching one string (ex.Hello-Welcome) in text file using SQL query. its searching Hello and Welcome seperatly and giving a result , i think bcoz hyphen(-) is a word breaker in SQL .can any one give me the idea how to resolve the problem. i need to use hyphen in searching string, and i need a combined string search result. thanks mahe

          CPalliniC Offline
          CPalliniC Offline
          CPallini
          wrote on last edited by
          #4

          You may escape the hyphen, see, for instance [^] (have a look at example "C. Using the ESCAPE clause"). :)

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
          [My articles]

          In testa che avete, signor di Ceprano?

          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