Re: Passing in multiple values to one parameter

From: Ace (Ace_at_discussions.microsoft.com)
Date: 09/14/04


Date: Mon, 13 Sep 2004 21:49:04 -0700

None of the following links seem to exist.

Thanx,

SK

"Andrew J. Kelly" wrote:

> Have a look here:
>
>
>
> http://www.algonet.se/~sommar/dynamic_sql.html Dynamic SQL
> http://www.users.drew.edu/skass/sql/ListToTableProc.sql.txt List to
> Table script
> http://www.aspfaq.com/show.asp?id=2248 Arrays & Lists
>
> --
> Andrew J. Kelly SQL MVP
>
>
> "Ace" <Ace@discussions.microsoft.com> wrote in message
> news:C4EEE342-ADDF-43F5-AE9E-A5811C822A47@microsoft.com...
> > Hello,
> >
> > I have a sproc declared like this.
> >
> > CREATE PROCEDURE [dbo].[GetMyResult]
> > @Param1 varchar(50)=null
> > AS...
> >
> > SELECT * FROM TABLE1
> > WHERE Col1 IN (@Param1)
> >
> > As you can see above, I need to select result set filtered based on values
> > passed in.
> >
> > First, is it how I should do?
> > Secondly, how can I call this sproc? Suppose I would like to return
> record
> > set which has Col1 value of either 98 or 99. How can I construct a
> calling
> > statement?
> >
> > EXEC GetMyResult @Param1='98,99'
> >
> > Then I get the following error.
> > "Syntax error converting the varchar value '98,99' to a column of data
> type
> > int."
> >
> > Please help!
> > Thanx,
> >
> >
>
>
>



Relevant Pages

  • Re: Row size and DBCC SHOWCONTIG
    ... Sorry but I didn't even see the script the first time. ... Andrew J. Kelly SQL MVP ... > It behaves the same way with or without a clustered index. ... >> Andrew J. Kelly SQL MVP ...
    (microsoft.public.sqlserver.programming)
  • Re: Database Backup
    ... Don't use EM, use a script instead. ... The restore syntax is ... Andrew J. Kelly SQL MVP ... >> Andrew J. Kelly SQL MVP ...
    (microsoft.public.sqlserver.server)
  • Re: How to generate drop and recreate index script in SQL Manageme
    ... Andrew J. Kelly SQL MVP ... Pier 1 Imports ... script similar to how it was done in 2000. ...
    (microsoft.public.sqlserver.tools)
  • Re: Moving Full database to Empty database
    ... Andrew J. Kelly SQL MVP ... > script droping of them? ... Do a Restore of the full db over top of the Empty DB. ... >> Andrew J. Kelly SQL MVP ...
    (microsoft.public.sqlserver.dts)
  • Re: Extremely high % Disk Time .. How is this possible??
    ... Andrew J. Kelly SQL MVP ... > Slicing them into logical drives may look better but it does not increase ... I prefer to look at disk queue ... >>> Andrew J. Kelly SQL MVP ...
    (microsoft.public.sqlserver.clustering)