Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 SQL Query 'Contains'

Author  Topic 

baijuep
Starting Member

15 Posts

Posted - 2012-08-25 : 11:53:27
I have a database name baijuep and a table named anil and field name course.
1. i want to count how much people are qualified in 'BTECH' from field course.
2. i want to display how much people are qualified in 'BTECH' from field course

I TRIED THIS
SELECT * FROM anil WHERE CONTAINS((COURSE), '"BTECH"')

THE ERROR COMES LIKE THIS

Msg 7601, Level 16, State 2, Line 1
Cannot use a CONTAINS or FREETEXT predicate on table or indexed view 'COL_DATA' because it is not full-text indexed.

baijuep

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-08-25 : 13:27:19
the error is obvious . CONTAINS,CONTAINSTABLE etc are full text search functions so unless you enable it you cant use them.

you can simply do like


SELECT * FROM anil WHERE COURSE LIKE '%BTECH%'


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

baijuep
Starting Member

15 Posts

Posted - 2012-09-07 : 21:27:40
thanks

baijuep
Go to Top of Page
   

- Advertisement -