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
 Transact-SQL (2005)
 Full Text Index

Author  Topic 

ddamico
Yak Posting Veteran

76 Posts

Posted - 2010-06-28 : 15:44:40
Hello,

I have been trying to do some performance enhancements to optimize a query. The original query looks something like this

SELECT PersonID
FROM dbo.Person
WHERE PersonCode like '%|%'

Now I have created a FullTextCatalog against the table for the column
PersonCode. I can't seem to get the CONTAINS clause correct to find the pattern as specified above

SELECT PersonID
FROM dbo.Person
WHERE CONTAINS(PersonCode, ' "*|*" ' )

I am wondering if this will even work? If this will work if anyone has can give me the proper syntax to make it work.

It should be noted the column contains data like

0000|abc
S000|abc|xyx
|||

Any direction would be greatly appreciated. thanks.
   

- Advertisement -