This error probably means that the value you are trying to insert into
a  foreign key column does not correspond to an actual row, I am
guessing that it is this line:

<cfprocparam
           type="In"
           cfsqltype="CF_SQL_INTEGER"
           dbvarname="intMemberIDUpdate"
           value="0">

Since the value of 0 does not correspond to a valid memberID.

If you have a foreign key constraint setup the proper way to handle
such as case would be to use a null value instead of a zero.  Or
remove the constraint if you really need to store a zero in there.

--
Pete Freitag
http://foundeo.com/ - ColdFusion Consulting & Products
http://petefreitag.com/ - My Blog
http://hackmycf.com - Is your ColdFusion Server Secure?



On Thu, Dec 16, 2010 at 2:16 PM, Monique Boea <[email protected]> wrote:
>
> Hello All.
>
> I have a stored proc that when I execute it from SQL server mgmt studio, it
> works fine. But when I try to execute it in CF, I get the following error:
>
> *Error Executing Database Query. [Macromedia][SQLServer JDBC
> Driver][SQLServer]The INSERT statement conflicted with the FOREIGN KEY
> constraint*
>
> Here is my code:
>
> <cfstoredproc procedure="spmembersII_savegroups" datasource="#request.dsn#"
> returncode="yes">
>          <cfprocparam
>                type="In"
>                cfsqltype="CF_SQL_INTEGER"
>                dbvarname="intInstitutionID"
>                value="541">
>          <cfprocparam
>                    type="In"
>                    cfsqltype="CF_SQL_INTEGER"
>                    dbvarname="intMemberID"
>                    value="10008">
>          <cfprocparam
>            type="In"
>            cfsqltype="CF_SQL_VARCHAR"
>            dbvarname="strStages"
>            value="">
>                      <cfprocparam
>            type="In"
>            cfsqltype="CF_SQL_INTEGER"
>            dbvarname="intMemberIDUpdate"
>            value="0">
>          <cfprocresult name="enrollmentquestions">
>        </cfstoredproc>
>
> Any suggestions?
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340108
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to