Link to home
Start Free TrialLog in
Avatar of Jeff S
Jeff SFlag for United States of America

asked on

SQL 2005 - Insert Into (Foreign Key Issue).

I think I have a Foreign Key issue and need some help on my insert.

Error Message recvd in application:

IDispatch error #3119
Number=547  State=23000  Source=Microsoft SQL Native Client
Description=The INSERT statement conflicted with the FOREIGN KEY constraint "FK_SC_ClearinghouseId". The conflict occurred in database "DemoCPS", table "dbo.Clearinghouse", column 'ClearinghouseId'.
Number=3621  State=01000  Source=Microsoft SQL Native Client
Description=The statement has been terminated.
Number=0  State=01000  Source=Microsoft SQL Native Client
Description=Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

INSERT  INTO dbo.Settings
        ( ClearinghouseId ,
          InsuranceCarrierCompanyId ,
          InsuranceCarrierCompanyProcessingId ,
          ECSInsuranceCarriersId ,
          PlugInId ,
          Type ,
          Name ,
          Value ,
          Created ,
          CreatedBy ,
          LastModified ,
          LastModifiedBy
        )
VALUES  ( 18 , -- ClearinghouseId - int
          NULL , -- InsuranceCarrierCompanyId - int
          NULL , -- InsuranceCarrierCompanyProcessingId - int
          NULL , -- ECSInsuranceCarriersId - int
          NULL , -- PlugInId - int
          'ClearinghouseTransmission' , -- Type - varchar(50)
          'AccountNumber' , -- Name - varchar(50)
          '13562' , -- Value - varchar(255)
          '2009-06-30 20:36:02' , -- Created - datetime
          'Jeff' , -- CreatedBy - varchar(30)
          '2009-06-30 20:36:02' , -- LastModified - datetime
          'Jeff'  -- LastModifiedBy - varchar(30)
        )

Open in new window

SOLUTION
Avatar of Aneesh
Aneesh
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jeff S

ASKER

which value? I have a ClearinghouseId with that Id number.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jeff S

ASKER

Yes, 18 exists. See attached screen shot.
6-30-2009-4-43-19-PM.pdf
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jeff S

ASKER

Split points to be fair.