Forums

ASP

This topic is locked

Stored Procs and Lists

Posted 05 Nov 2003 19:59:49
1
has voted
05 Nov 2003 19:59:49 Phil Atkinson posted:
I have a checkbox that will send one or more variables to the next page. Accordingly, I have an SQL statement that uses IN (as opposed to using OR). If I embed the SQL in the SQL page, I don't have a problem. However, in order to improve performance, I would like to create the SQL as a stored proc and send the variable to the server.

Is this possible? If yes, what the most effective solution?

Thanks

Replies

Replied 11 Nov 2003 00:18:09
11 Nov 2003 00:18:09 Phil Shevlin replied:
Its possible, but we would need more info before someone could suggest "effectiveness"
Replied 13 Nov 2003 01:17:55
13 Nov 2003 01:17:55 Phil Atkinson replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Its possible, but we would need more info before someone could suggest "effectiveness"
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
I basically have a simple checkbox form that offers the user 1 or more selections. Accordingly 1 or more variables are sent as a string to results.asp. If for example GERMAN & DUTCH have been selected, GERMAN,DUTCH is passed. However is use some simply VBscript to change the string to GERMAN','DUTCH which is then inserted into the following stored proc.

CREATE Procedure TestProc
@varMarket as varchar(100)
AS
DECLARE @SQL varchar(8000)
set @SQL = 'Select * From CO_Contract Where CO_CM_ID IN (' + @varMarket + ')'
EXEC (@SQL)
GO

However when I test the proc I get "Invalid Column Name 'GERMAN' for example when testing only one variable. I don't understand this at all.

Any ideas?
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Reply to this topic