Wrox Programmer Forums
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 10th, 2004, 01:30 PM
Registered User
 
Join Date: Nov 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Hadware Send a message via Yahoo to Hadware
Default Using FREETEXT

the sntax for using freetext is
FREETEXT ( { column | * } , 'freetext_string' )

I put together a test like:
SELECT description_of_problem
FROM servicerequests
WHERE FREETEXT(description_of_problem, @description)
and it worked fine

What I have a a text box in a search form that may or may not be used. I can use this syntax for that situation
ISNULL ( check_expression , replacement_value )

So I put this together (without freetext):
(part of a where clause)
and (sr.description_of_problem = isnull(@desc, sr.description_of_problem) or sr.description_of_problem is null)

I need to use FREETEXT so what I came up with in the integration looks like this, which seems logical to me:
and (FREETEXT(sr.description_of_problem, isnull(@description, sr.description_of_problem)) or sr.description_of_problem is null)

Problem is I can't get it to work right...
Incorrect syntax near isnull is what I get in query analyzer.

Can anyone help?
Thanks





Similar Threads
Thread Thread Starter Forum Replies Last Post
Enable Freetext in SQL2000 ankur_icfai SQL Server 2000 1 October 24th, 2006 03:23 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.