Solved

search

Posted on 1998-09-08
3
210 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 30 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

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…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.

726 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