Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

search

Posted on 1998-09-08
3
Medium Priority
?
237 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 1

Author Comment

by:mativare
ID: 1089967
Edited text of question
0
 
LVL 2

Accepted Solution

by:
formula earned 120 total points
ID: 1089968
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
ID: 1089969
It works, but it takes away power of CONTAINS
see question Search II too
0

Featured Post

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

618 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