Search Sql table for a word contains some letters
-
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
-
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
If it is letters in a series (rather than any word containing any of these letters) you can use WHERE ItemName like '%xyz%'
-
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
-
As in previous post use
LIKE
for simple pattern matching or if you need more logic for the search, useCONTAINS
[^] predicate.The need to optimize rises from a bad design. My articles[^]
-
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
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
-
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
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[^]