This is a discussion on Sending data to a Stored Procedure with ASP error within the SQL Server forums, part of the Microsoft SQL Server category; --> Hi all.. I'm trying to send multiple INT values to a Stored Procedure that will be handled in an ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi all.. I'm trying to send multiple INT values to a Stored Procedure that will be handled in an IN statement. ASP Code: strSQL = "SP_Get_Selections '29, 32' where 29 and 32 are 2 integer values Now, in my stored procedure... I would like to look these values up in an IN statement like CREATE Procedure SY_GET_SELECTIONS @authorid varchar(20) SELECT * FROM Authors WHERE AuthorID IN (@authorid) But when I use this, I get [Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the varchar value '29, 32' to a column of data type int. Any help would be great. Thanks |
| ||||
| <mikeyatsony@gmail.com> wrote in message news:1115842205.805890.34120@g47g2000cwa.googlegro ups.com... > Hi all.. > > I'm trying to send multiple INT values to a Stored Procedure that will > be handled in an IN statement. > > ASP Code: > strSQL = "SP_Get_Selections '29, 32' > > where 29 and 32 are 2 integer values > > Now, in my stored procedure... I would like to look these values up in > an IN statement like > > CREATE Procedure SY_GET_SELECTIONS > @authorid varchar(20) > SELECT * FROM Authors WHERE AuthorID IN (@authorid) > > But when I use this, I get [Microsoft][ODBC SQL Server Driver][SQL > Server]Syntax error converting the varchar value '29, 32' to a column > of data type int. > > Any help would be great. > Thanks > http://www.sommarskog.se/arrays-in-sql.html Simon |