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.
| Author |
Topic |
|
udaymahajan
Starting Member
17 Posts |
Posted - 2008-10-04 : 06:15:32
|
| Hi i want to search records using a word,or some text from databasefor this SELECT Frm.ForumID, ForumCategoryName, [ForumTopic] ,Post FROM [Forums] Frm inner join (SELECT ForumID,count(ForumID)as Post,max(ForumRepliesDate) as LastPost FROM [ForumReplies] group by ForumID) Fr on Frm.ForumID=Fr.ForumID inner join ForumReplies frs on Fr.LastPost=frs.ForumRepliesDate inner join ForumCategories fc on Frm.[ForumCategoryID]=fc.[ForumCategoryID] where Frm.[Enable]=1 AND (FREETEXT(frs.ForumReplies,'Any higher level players')) order by ForumDate descbut using FREETEXT is shows error asCannot use a CONTAINS or FREETEXT predicate on table or indexed view 'ForumReplies' because it is not full-text indexed.so how can i solve and display recordsuday |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-10-04 : 06:38:28
|
| you need to fulltext index the table or view before using full text search functions like FREETEXT,CONTAINS etc. However you could try like thisSELECT Frm.ForumID,ForumCategoryName,[ForumTopic],PostFROM [Forums] Frm inner join (SELECT ForumID,count(ForumID)as Post,max(ForumRepliesDate) as LastPostFROM [ForumReplies] group by ForumID) Fr on Frm.ForumID=Fr.ForumID inner join ForumReplies frson Fr.LastPost=frs.ForumRepliesDate inner join ForumCategories fc on Frm.[ForumCategoryID]=fc.[ForumCategoryID]where Frm.[Enable]=1 AND PATINDEX('%Any higher level players%',frs.ForumReplies)>0order by ForumDate desc |
 |
|
|
udaymahajan
Starting Member
17 Posts |
Posted - 2008-10-04 : 07:46:36
|
quote: Originally posted by visakh16 you need to fulltext index the table or view before using full text search functions like FREETEXT,CONTAINS etc. However you could try like thisSELECT Frm.ForumID,ForumCategoryName,[ForumTopic],PostFROM [Forums] Frm inner join (SELECT ForumID,count(ForumID)as Post,max(ForumRepliesDate) as LastPostFROM [ForumReplies] group by ForumID) Fr on Frm.ForumID=Fr.ForumID inner join ForumReplies frson Fr.LastPost=frs.ForumRepliesDate inner join ForumCategories fc on Frm.[ForumCategoryID]=fc.[ForumCategoryID]where Frm.[Enable]=1 AND PATINDEX('%Any higher level players%',frs.ForumReplies)>0order by ForumDate desc
this is not working i tried same solution,send another solutionuday |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-10-04 : 07:51:43
|
quote: Originally posted by udaymahajan
quote: Originally posted by visakh16 you need to fulltext index the table or view before using full text search functions like FREETEXT,CONTAINS etc. However you could try like thisSELECT Frm.ForumID,ForumCategoryName,[ForumTopic],PostFROM [Forums] Frm inner join (SELECT ForumID,count(ForumID)as Post,max(ForumRepliesDate) as LastPostFROM [ForumReplies] group by ForumID) Fr on Frm.ForumID=Fr.ForumID inner join ForumReplies frson Fr.LastPost=frs.ForumRepliesDate inner join ForumCategories fc on Frm.[ForumCategoryID]=fc.[ForumCategoryID]where Frm.[Enable]=1 AND PATINDEX('%Any higher level players%',frs.ForumReplies)>0order by ForumDate desc
this is not working i tried same solution,send another solutionuday
before that post your exact requirement |
 |
|
|
|
|
|
|
|