search

MSSQL 7.0 beta
I full-text- indexed my table and it is fully operational
I need a help with this SP syntax
CREATE  PROCEDURE SPsearchGeneraldescription
@str char(10)
 AS
SELECT Auto, description
FROM [general]  
WHERE CONTAINS (description,  '@str')
It returns 0 rows, no errors but similar select statement
returns plenty of rows, I tried double quotes too surrounding argument
Without quotes I got syntax error
Any help appreciated
LVL 1
mativareAsked:
Who is Participating?
 
formulaConnect With a Mentor Commented:
Do the following:

1) Add statement to create a Search string in stored procedure:
   declare @newstring varchar(10)
   select @newstring = "%"+@str+"%"
2) Modify Select
   SELECT Auto, description
   FROM [general]  
   WHERE description like @newstring


0
 
mativareAuthor Commented:
Edited text of question
0
 
mativareAuthor Commented:
It works, but it takes away power of CONTAINS
see question Search II too
0
All Courses

From novice to tech pro — start learning today.