Wednesday, March 21, 2007

SELECT Using a Full Text Catalog in SQL Server

This is a pretty simple example. There's a heck of a lot more that you can do.
SELECT Distinct(i.imageFile), i.caption, i.fileID, i.fragmentID, i.path, c.title 
FROM metadata_image AS m JOIN image AS i ON
LEFT JOIN fragments AS c ON i.fragmentID=c.cid
WHERE Contains(i.*, '"some" or "word"') OR
Contains(c.*, '"some" or "word"') OR
Contains(m.*, '"some" or "word"')
ORDER BY c.title, i.caption

No comments: