Re: Passing in a Parameter



On Thu, 28 Apr 2005 08:04:09 -0700, Kunkel wrote:

>Hi All,
>
>I have a Stored Proc and would like to pass in a VARCHAR parameter. The
>problem is that the query will need to use it in a IN clause...
>
>DECLARE @PARAM AS VARCHAR(20)
>SET @PARAM = 'Dan', 'Mike', 'Lisa'
>
>SELECT *
>FROM Orders
>WHERE Name IN (@PARAM)
>
>is there a away around this?

Hi Kunkel,

Several. And they are all described and compared at
http://www.sommarskog.se/arrays-in-sql.html

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)
.



Relevant Pages

  • Re: stored proc RETURN_VALUE.... there it is, I want to use it !!!
    ... > Then you can read the value of @total after closing the query. ... > 2 Set up your input param values. ... the result of this sql code returns an integer that is ... >> take the guts of the stored proc with hard coded guestid and meeting ...
    (borland.public.delphi.database.ado)
  • Passing in a Parameter
    ... I have a Stored Proc and would like to pass in a VARCHAR parameter. ... problem is that the query will need to use it in a IN clause... ... DECLARE @PARAM AS VARCHAR ...
    (microsoft.public.sqlserver.mseq)
  • RE: parameter in sql query
    ... Just set connection string to run it. ... > If the substition is before...the error seems to imply that the query is ... > being transferred to the sql server without the parameter being replaced ... > creating a datacomponent with a sql param, ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: stored proc RETURN_VALUE.... there it is, I want to use it !!!
    ... Then you can read the value of @total after closing the query. ... Set up your input param values. ... > take the guts of the stored proc with hard coded guestid and meeting code ...
    (borland.public.delphi.database.ado)
  • Re: parameter in sql query
    ... Could you try expanding the autogenerated code and posting ... > Does the parameter substitution occur after or before the query is sent to ... > being transferred to the sql server without the parameter being replaced ... '@Start' is the name of the param and the error says there ...
    (microsoft.public.dotnet.framework.compactframework)