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
 General SQL Server Forums
 New to SQL Server Programming
 CONTAINS??

Author  Topic 

rds207
Posting Yak Master

198 Posts

Posted - 2009-08-17 : 17:35:12
I AM WORKING ON SQL SERVER 2007 AND TRYING TO USE CONTAINS KEY WORK BUT I GET THE ERROR
Cannot use a CONTAINS or FREETEXT predicate on table or indexed view 'ASWProductionDatabase.dbo.BatchRecords' because it is not full-text indexed.
MY QUERY IS
Select b.phonebuild,*
From ASWProductionDatabase.dbo.BatchRecords a ,ASWProductionDatabase.dbo.PHONE_VERSIONS b
Where CONTAINS(JobName ,'"M6246ALPRQL12004203*"')
And left(B.phonebuild,17)=left(a.jobname,17)
ORDER BY Built_DT

I DONT HAVE ANY COLOUMNS IN BOTH THE TABLES(BATCHRECORDS AND PHONE_VERSIONS) WHICH ARE COMMON EXCEPT THE JOBNAME(FROM BATCH RECORDS) WHICH MATCHES WITH PHONE BUILD(FROM PHONE_VERSIONS),SO I AM TRYING TO FIND THE JOBNAME WHICH LOOKS LIKE M6246ALPRQL12004203Blueprint_30JUN2009_032801am
AND THE RELATED PHONE LOOKS LIKE
M6246ALPRQL12004203

PLEASE HELP !

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2009-08-17 : 17:40:20
If you haven't implemented full-text searching than you can't use CONTAINS (as the error says)

try:
where JobName like '%M6246ALPRQL12004203%'

Be One with the Optimizer
TG
Go to Top of Page

rds207
Posting Yak Master

198 Posts

Posted - 2009-08-17 : 18:10:00
thank you,can you pls reply this
Here is the list of the data IN A COLOUMN i have , is there any query where i can sort with the number of chars in a coloumns in SQL SERVER 2007,LIKE I WANT ALL THE BUILDS WITH 14CHARS FIRST LIKE THEN 15 THEN 16 SO ON..
BUILDS
M6260ALYRQ2510
M6260ALYRQ2510
M6260ALYRQ2510gh
M6260ALYRQ2510
M6260ALYRQ2510
M6281ALLRQ4096fg
M6281ALLRQ4096
M6280ALLRQ4090fg
M6281ALLRQ4096
M6260ALYRQ2510r
M6260ALYRQ2510
M6260ALYRQ2510e
quote:
Originally posted by TG

If you haven't implemented full-text searching than you can't use CONTAINS (as the error says)

try:
where JobName like '%M6246ALPRQL12004203%'

Be One with the Optimizer
TG

Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2009-08-17 : 18:27:03
don't cross post. http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=131317


elsasoft.org
Go to Top of Page
   

- Advertisement -