RE: Need help with stored procedure.

From: marcmc (marcmc_at_discussions.microsoft.com)
Date: 03/14/05


Date: Mon, 14 Mar 2005 03:17:03 -0800

There a a number of ways to do this, here are two.

SELECT * FROM table1 WHERE @String like '%word3%'
SELECT * FROM table1 WHERE @String = 'word3'

"Vanessa Lee" wrote:

> Hi,
> I am using SQL Server 2000 on Windows 2000 server. Here is my problem:
>
> @String = 'word1word2word3word4word5' - This value is passed to Stored
> Procedure from the script.
>
> Column1 in a table1 has many rows with "words" . One row in this column1
> will have 'word3'. Notice that this 'word3' is contained in the @String.
>
> I need to write a stored procedure SELECT statement that will return all
> (Select *) values from all columns corresponding to a row containing
> 'word3'. (this 'word3' must be found in @String). 'word3' is the entire
> value of the column. Somehow the search will have to be done on @String to
> see if there is a match, and if there is a match, return values of all
> columns corresponding to this row where the match is found.
>
> It will have to be something like:
>
> SELECT * FROM table1 WHERE @String has 'word3' in it.
>
> I need help with the statement after the WHERE command.
>
> Thank you for your help.
> Vanessa
>
>
>



Relevant Pages

  • Re: composite key question
    ... Each time you do an insert SQL ... it's probably not a stored procedure. ... queries to perform slower, however. ... Seeing as how that script you sent was not a stored proc, ...
    (microsoft.public.sqlserver.programming)
  • source text file as input parameter from a stored procedure
    ... I am using an active X script in combination with a global ... transform task that loads data from a .txt file to a table. ... I can also tell that the stored procedure is correctly passing in the ... EXEC sp_OAGeterrorinfo @object, @hr ...
    (microsoft.public.sqlserver.dts)
  • RE: Error 207 doing Transactional replication via Internet
    ... stored procedure from the script we were running. ... Some of them you didn't want to move to the subscriber so you ... For the QQRMGR user you ...
    (microsoft.public.sqlserver.replication)
  • Re: What does the .run method return
    ... 'stored procedure', yet your example is a VBS script. ... I have a batch job that calls a VBscript. ...
    (microsoft.public.scripting.vbscript)
  • Re: Newbie - Stored Procedures/ASP Question
    ... I tried shortening the Stored Procedure, and using the script from your ... The SQL Stored Procedure is below. ...
    (microsoft.public.inetserver.asp.db)