SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Need help with a stored procedure using CONTAINS
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

wickedhangover
Starting Member

5 Posts

Posted - 09/28/2007 :  09:32:46  Show Profile  Reply with Quote
Ok, here's the problem I am having that I do not really understand. I'm creating an assembly to do this so in basic terms, this is what my code implies:

select * from someDatabase where contains(*,'"some search phrase"')

in terms of the stored procedure it would be something like
declare @searchPhrase

select * from someDatabase where contains(*,@searchPhrase)

This only works if the search phrase is a single word, what is the syntax I need to use in the stored procedure to emulate using '"..."' as opposed to what seems to be the default '...' ?

Kristen
Test

United Kingdom
22403 Posts

Posted - 09/28/2007 :  10:51:33  Show Profile  Reply with Quote
Does this not do the Phrase thingie?

declare @searchPhrase

SET @searchPhrase = '"some search phrase"'
select * from someDatabase where contains(*,@searchPhrase)

Kristen
Go to Top of Page

wickedhangover
Starting Member

5 Posts

Posted - 09/28/2007 :  11:35:21  Show Profile  Reply with Quote
I think this might have answered my question. I need to look into this sort of method to see if it will work. I guess the problem is that since this is all generated as a CLR assembly and I am using .net specific syntax to generate the variables, I never have the chance to initialize the value in that manner. But I might know of a work around that will.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000