Re: Stored procedure - parameter in IN clause

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Aaron [SQL Server MVP] (ten.xoc_at_dnartreb.noraa)
Date: 08/13/04


Date: Fri, 13 Aug 2004 12:39:25 -0400

Also see http://www.aspfaq.com/2248

-- 
http://www.aspfaq.com/
(Reverse address to reply.)
"Mindy Zhang" <mindyzhang@hotmail.com> wrote in message
news:e17a4vUgEHA.1972@TK2MSFTNGP09.phx.gbl...
> Hi,
>
> I created a stored procedure with three parameters in SQL server 2000.
Data
> types are datatime, integer and char.  The last parameter value looks like
> '1234AB', '1234TG', '7890IK'.  I got a problem when I tried to EXECUTE the
> stored procedure because of the commas in the last parameter.  Any ideas?
> Here is my stored procedure.
>
> CREATE PROCEDURE usp_select_data @start_dt datetime, @pt_number int ,
@form
> char(6)  AS
> BEGIN
>
> SELECT *
> FROM table1
> WHERE table1.column1 = @start_dt and
> table1.column2 = @pt_number
> table1.column3 IN (@form)
>
> END
>
> Thank you.
>
> Mindy
>
>


Relevant Pages

  • Re: [OT] Oracle Question
    ... > Any Oracle specialists lurking? ... > A second table (TABLE2) containing metadata about the stuff in TABLE1. ... > Finally a stored procedure that takes TABLE1 data after being ...
    (uk.rec.motorcycles)
  • Re: loooking for temp tables suggestions
    ... Select * from table1 ... Can I access that table in the stored procedure just the same? ... > (mytempcol1 datatype, ... > If you have the memory, try and use the @ tables. ...
    (microsoft.public.sqlserver.programming)
  • Re: Stored Procedure question
    ... SQL Server MVP ... "rob" wrote in message ... > Within a stored procedure I am doing the follwing... ... > insert into table2 select aa from table1 ...
    (microsoft.public.sqlserver.programming)
  • RE: Handling multiple result sets
    ... TableMappings, you can give these tables real names. ... Table and Table1. ... > I have a stored procedure that returns two sets of> data. ... > Is it possible to handle these two results within a single call to the sql> server, as I do not want to have to do a second return trip to the server> ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Returning a "Table" type from a stored procedure
    ... Return type for a stored procedure is always integer ... There is no sense to return output parameter via RETURN ... Is there anything wrong with my sql statements? ... SELECT * FROM Table1 ...
    (microsoft.public.dotnet.framework.adonet)