[thelist] oh joy -- cursors and t-sql abound!
Tom McMillen
tgmcmillen at yahoo.co.uk
Fri Jun 14 17:31:01 CDT 2002
Have you tried looking in SQL BOL (Using
CONTAINSTABLE)?
There are a couple of examples there where the
CONTAINSTABLE section is built dynamically as a
string inside an EXECUTE() statement...
so you would have
STATIC READ ONLY FOR
EXECUTE('SELECT article_id, max(k.rank) rank
FROM paragraphs t1
INNER JOIN CONTAINSTABLE(paragraphs,
paragraph_text, ' + @term + ') k
ON t1.paragraph_id = k.[key]')
I've not tried it, but it might work
Tom
>
> I'm having a bit of difficulty with a particularly
> complex query I'm
> running.
<snip />
> but the problem I'm
> having is with parameters that I want to pass into
> the sp itself. Take a
> look at this cursor declaration:
>
> DECLARE tnames_cursor CURSOR LOCAL FORWARD_ONLY
> STATIC READ_ONLY
> FOR
> SELECT article_id, max(k.rank) rank
> FROM paragraphs t1
> INNER JOIN CONTAINSTABLE(paragraphs,
> paragraph_text, @term) k
> ON t1.paragraph_id = k.[key]
<snip />
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
More information about the thelist
mailing list