How to search word starting with character 'a' Sql Full Text Indexing
-
Hi guys, need some help. i am trying to create a Full text index query for searching all the records having words starting with a particular character for eg. 'A' i tried using Contains Clause with '*' wild card my query is :-
select * from table where contains (columname,'"A*"');
results are coming fine but the problem is that it returns all the records in which there is any word between the string starting with A . I need only those records in which the starting char of the column is 'A' similar to the query -
select * from table where columname like 'A%'
but i dont want to use like query as it will slower the results .. any help will be appreciated
abhinav
-
Hi guys, need some help. i am trying to create a Full text index query for searching all the records having words starting with a particular character for eg. 'A' i tried using Contains Clause with '*' wild card my query is :-
select * from table where contains (columname,'"A*"');
results are coming fine but the problem is that it returns all the records in which there is any word between the string starting with A . I need only those records in which the starting char of the column is 'A' similar to the query -
select * from table where columname like 'A%'
but i dont want to use like query as it will slower the results .. any help will be appreciated
abhinav
Contains appears to be working exactly like it should, you'll have to use like or construct a more complicated contains clause, if you're using sql server 2k the transact sql help in the query analyzer tool has some decent examples and a rather good explination for almost anything sql.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.