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. Search Sql table for a word contains some letters

Search Sql table for a word contains some letters

Scheduled Pinned Locked Moved Database
csharpasp-netdatabasesql-serversysadmin
6 Posts 4 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.
  • Y Offline
    Y Offline
    y_mmohd
    wrote on last edited by
    #1

    I wan to search sql server table to find any word contains some all the letter what should i do. I'm using Asp.net vb to create web page. I create a text box I want to search for special letters. I'm using sqldatasource to connect to sql server with the following procedure: SELECT Name, Emai FROM Item WHERE (itemName = @itemName) What should i do instead of (itemName = @itemName) Thanks

    P W 2 Replies Last reply
    0
    • Y y_mmohd

      I wan to search sql server table to find any word contains some all the letter what should i do. I'm using Asp.net vb to create web page. I create a text box I want to search for special letters. I'm using sqldatasource to connect to sql server with the following procedure: SELECT Name, Emai FROM Item WHERE (itemName = @itemName) What should i do instead of (itemName = @itemName) Thanks

      P Offline
      P Offline
      Paddy Boyd
      wrote on last edited by
      #2

      If it is letters in a series (rather than any word containing any of these letters) you can use WHERE ItemName like '%xyz%'

      1 Reply Last reply
      0
      • Y y_mmohd

        I wan to search sql server table to find any word contains some all the letter what should i do. I'm using Asp.net vb to create web page. I create a text box I want to search for special letters. I'm using sqldatasource to connect to sql server with the following procedure: SELECT Name, Emai FROM Item WHERE (itemName = @itemName) What should i do instead of (itemName = @itemName) Thanks

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

        As in previous post use LIKE for simple pattern matching or if you need more logic for the search, use CONTAINS[^] predicate.

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

        Y 1 Reply Last reply
        0
        • W Wendelius

          As in previous post use LIKE for simple pattern matching or if you need more logic for the search, use CONTAINS[^] predicate.

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

          Y Offline
          Y Offline
          y_mmohd
          wrote on last edited by
          #4

          Thanks for this help.I'm trying apply it on the asp.net web page there was an error occur. cannot use a contains or free text predicate on table or indexed view "item" because it is not full-text indexed What should i do thanks

          A W 2 Replies Last reply
          0
          • Y y_mmohd

            Thanks for this help.I'm trying apply it on the asp.net web page there was an error occur. cannot use a contains or free text predicate on table or indexed view "item" because it is not full-text indexed What should i do thanks

            A Offline
            A Offline
            Ashfield
            wrote on last edited by
            #5

            y_mmohd wrote:

            cannot use a contains or free text predicate on table or indexed view "item" because it is not full-text indexed

            therefore you can either create a full-text index on the column OR use the LIKE expression - as you have been told several times.

            y_mmohd wrote:

            I'm trying apply it on the asp.net web page

            is totally irrelevant, its your sql query that is wrong.

            Bob Ashfield Consultants Ltd

            1 Reply Last reply
            0
            • Y y_mmohd

              Thanks for this help.I'm trying apply it on the asp.net web page there was an error occur. cannot use a contains or free text predicate on table or indexed view "item" because it is not full-text indexed What should i do thanks

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

              For creating full text indexes see: CREATE FULLTEXT INDEX (Transact-SQL)[^] But as said before, if your query need is simple use LIKE. Mika

              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