Make sure the length of the list you're passing is the same as or less than the number of parameters the stored proc expects.
Mike Wallick * Web Application Developer * [EMAIL PROTECTED] * 651.628.5377 * http://www.securecomputing.com/ -----Original Message----- From: Jason [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 10, 2002 10:26 AM To: CF-Talk Subject: RE: Passing a list to a Stored Procedure When I try that I get the following error: [Microsoft][ODBC SQL Server Driver][SQL Server]Procedure or function MasterAssignments has too many arguments specified. Great idea though, I will continue to work on it. Jason -----Original Message----- From: Wallick, Mike [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 10, 2002 8:23 AM To: CF-Talk Subject: RE: Passing a list to a Stored Procedure Send each element of the list as it's own <cfprocparam>. Like this: <cfstoredproc procedure="procedure" datasource="#dsn1#" returncode="No" debug="No"> <cfloop index="this" list="#list#"> <cfprocparam type="In" cfsqltype="CF_SQL_INTEGER" value="#this#"> </cfloop> </cfstoredproc> That will send the values to the stored proc as (value1,value2,valueN). Mike Wallick * Web Application Developer * [EMAIL PROTECTED] * 651.628.5377 * http://www.securecomputing.com/ -----Original Message----- From: Jason [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 10, 2002 10:17 AM To: CF-Talk Subject: Passing a list to a Stored Procedure Sorry for the somewhat OT Post, but this is one of my better resources for CF I have I was wondering if anybody had any code snippets for passing a list to a SQL Server 2000 stored procedure. I have the CF front-end working fine but when I send the list (61755,61754) to the stored procedure I get no results, when I pass a singe variable (61755), I get the results that I am looking for. Here is my stored procedure: CREATE PROCEDURE MasterAssignments @ClientList nvarchar (4000) AS SELECT Assignments.dbnum, Master.prim_name, Master.prim_ssn, SUM(Assignments.currbal) AS TotalBalance FROM Assignments INNER JOIN Master ON Master.dbnum = Assignments.dbnum WHERE Assignments.clnt IN (@clientList) GROUP BY Assignments.dbnum, Master.prim_name, Master.prim_ssn ORDER BY Master.prim_name GO Any suggestions or leads would be very helpful, I have been working on this problem for a couple of days know Thanks Jason Larson [EMAIL PROTECTED] ______________________________________________________________________ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists