Input and output paramters belong before the "AS" statement... You're
declaring a local variable in your SP, not a parameter.

CREATE PROCEDURE sp_CheckUser

@UserName VARCHAR(50)

AS

----- Original Message ----- 
From: "Stan Winchester" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, June 05, 2003 4:51 PM
Subject: stored procedure error "...no parameters and arguments were
supplied"


> I've created a stored procedure for SQL Sever 2000 as shown below, and it
> works fine if I don't pass any values to it with cfprocparam (also shown
> below), but if I do I get the following error:
> ---------------------------
> ODBC Error Code = 37000 (Syntax error or access violation)
>
> [Microsoft][ODBC SQL Server Driver][SQL Server]Procedure sp_CheckUser has
no
> parameters and arguments were supplied.
> ---------------------------
>
> CREATE PROCEDURE sp_CheckUser
> AS
> DECLARE @UserName VARCHAR(50)
> SELECT TBL_System.UserName
> FROM TBL_System
> WHERE UserName = @UserName
> UNION
> SELECT TBL_ClubReps.UserName
> FROM TBL_ClubReps
> WHERE UserName = @UserName
> UNION
> SELECT TBL_Adv.UserName
> FROM TBL_Adv
> WHERE UserName = @UserName;
> GO
>
> <cfstoredproc procedure="sp_CheckUser"
>               datasource="#Request.DNS#">
>    <cfprocparam type="In"
>              cfsqltype="CF_SQL_VARCHAR"
>              dbvarname="@UserName"
>              value="#UserName#">
>   <cfprocresult name="GetCheckUser">
> </cfstoredproc>
>
> Stan Winchester
> [EMAIL PROTECTED]
> http://www.aftershockweb.com/
> Tel. 503-244-3440
> Fax 503-244-3454
>
>
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to