TheWizardofInt
Well-known member
I have a Table called GridGroups with a primary field GridGroupID
There is a secondary table called GridTrans which also has a field, GridGroupID, which is not primary.
This second table uses a ForeignKey relationship to the primary for the two GridGroupIDs. Dont ask me why - not my database, and I dont like Foreign Keys for just this reason.
Now I want to delete the GridGroups, so (and correct me if I am wrong) I should:
1. Delete all of the rows in GridTrans with this GridGroupID
2. THEN delete the one row in GridGroups with that GridGroupID
I can do (1), (2) throws this error:
Integrity constraint violation: Primary key for row in table GridGroups is referenced by foreign key...
Have I missed a step here? This, by the way, is a Sybase database
There is a secondary table called GridTrans which also has a field, GridGroupID, which is not primary.
This second table uses a ForeignKey relationship to the primary for the two GridGroupIDs. Dont ask me why - not my database, and I dont like Foreign Keys for just this reason.
Now I want to delete the GridGroups, so (and correct me if I am wrong) I should:
1. Delete all of the rows in GridTrans with this GridGroupID
2. THEN delete the one row in GridGroups with that GridGroupID
I can do (1), (2) throws this error:
Integrity constraint violation: Primary key for row in table GridGroups is referenced by foreign key...
Have I missed a step here? This, by the way, is a Sybase database