Having problems with my 1st stored procedure.
We have ColdFusion MX6.1 and SQL server 2005.
The server administrator says my login has all permissions.
---------getting this error
[Macromedia][SQLServer JDBC Driver][SQLServer]EXECUTE permission denied on object 'try1', database 'MED_ESTEPS', schema 'dbo'.
The error occurred in C:\Inetpub\ line 25
23 : <cfprocparam cfsqltype="cf_sql_char" value="#codestate#">
24 : <cfprocparam cfsqltype="cf_sql_char" value="#namestate#">
25 : <cfprocparam cfsqltype="cf_sql_numeric" type="out" variable="stateid">
26 : </cfstoredproc>
27 : <cfoutput>
-------this is the cfm called books.cfm,dso is set in[Application.cfm and works for other queries
--------this is the stored procedure try1 in try1.sql
We have ColdFusion MX6.1 and SQL server 2005.
The server administrator says my login has all permissions.
---------getting this error
[Macromedia][SQLServer JDBC Driver][SQLServer]EXECUTE permission denied on object 'try1', database 'MED_ESTEPS', schema 'dbo'.
The error occurred in C:\Inetpub\ line 25
23 : <cfprocparam cfsqltype="cf_sql_char" value="#codestate#">
24 : <cfprocparam cfsqltype="cf_sql_char" value="#namestate#">
25 : <cfprocparam cfsqltype="cf_sql_numeric" type="out" variable="stateid">
26 : </cfstoredproc>
27 : <cfoutput>
-------this is the cfm called books.cfm,dso is set in[Application.cfm and works for other queries
Code:
<html>
<head>
<title>
</title>
</head>
<body>
<cfset codestate='CA'>
<cfset namestate='California'>
<cfif isdefined('codestate')>
<cfstoredproc procedure="dbo.try1" datasource="#dso#">
<cfprocparam cfsqltype="cf_sql_char" value="#codestate#">
<cfprocparam cfsqltype="cf_sql_char" value="#namestate#">
<cfprocparam cfsqltype="cf_sql_numeric" type="out" variable="stateid">
</cfstoredproc>
<cfoutput>
new*#stateid#*
</cfoutput>
</cfif>
</body>
</html>
Code:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE dbo.try1
(
@arg_codestate CHAR(2),
@arg_namestate CHAR(10),
@arg_bookid INT OUT
)
AS
BEGIN
SET NOCOUNT ON
INSERT INTO codestates (codestate,namestate)
VALUES (@arg_codestate,@arg_namestate);
SELECT @arg_bookid=@@IDENTITY;
END;
GO