OLE DB Error when performing DELETE
Posted: Thu 29 Apr 2010 23:58
I'm attempting to delete rows from two of my tables. The tables have a one-to-many relationship, and I've attached a screenshot of their definition and relationship so you can see how they're structured.
The second table has a foreign key into the first, and the "ON DELETE" rule for this relationship is set to "CASCADE". In other words, when I delete a row from the first "parent" table, any linked rows in the second "child" table should automatically be deleted as well. This is in fact what happens when I perform simple SQL DELETE statements from the MS SQL Server Management utility.
However, when executing the same commands via a TMSSQL component from the SDAC library, I get the following OLE DB error. Based on MS documentation, the error code provided means the following:
[/img]
The second table has a foreign key into the first, and the "ON DELETE" rule for this relationship is set to "CASCADE". In other words, when I delete a row from the first "parent" table, any linked rows in the second "child" table should automatically be deleted as well. This is in fact what happens when I perform simple SQL DELETE statements from the MS SQL Server Management utility.
However, when executing the same commands via a TMSSQL component from the SDAC library, I get the following OLE DB error. Based on MS documentation, the error code provided means the following:
Any idea why the delete won't work properly using the SDAC component? I can always go and delete the linked rows first from the child table, but why should I have to if I've properly established an ON DELETE CASCADE relationship?0x00040EDC 265948
Updating this row caused more than one row to be updated in the data source
[/img]