Solved

search

Posted on 1998-09-08
3
160 Views
Last Modified: 2010-03-19
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
0
Comment
Question by:mativare
  • 2
3 Comments
 
LVL 1

Author Comment

by:mativare
Comment Utility
Edited text of question
0
 
LVL 2

Accepted Solution

by:
formula earned 30 total points
Comment Utility
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
 
LVL 1

Author Comment

by:mativare
Comment Utility
It works, but it takes away power of CONTAINS
see question Search II too
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Truncate vs Delete 63 87
Selecting specific rows 3 33
t-sql month question 8 40
SQL query to summarize items per month 5 24
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now