Hi all.

Is there a way to tell SQL Server that the string you are passing it in a
stored procedure should be evaluated as a list of numbers, not a string?  I�
m passing it a an HTML form field list.

Here�s a test I did for the stored procedure:

declare @mylist varchar(50)
set @mylist = '34,35,36,37'

select * from focusareas
where focusareaid IN (@mylist)

the @mylist variable is actually going to be my form field list which will
have the values.  Problem is, SQL sees it as ONE String value, not a list of
values and gives me this error:

Syntax error converting the varchar value '34,35,36,37' to a column of data
type int.

I�ve tried just about everything.  Even if I make double quotes around all
the numbers, it still treats the whole thing as one string.

Any ideas?
-Craig

Please reply to: [EMAIL PROTECTED]



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to