I'm not that great with SQL, but I can get by. DELETEs have always been somethng that have given me trouble. So, I thought I'd share this simple fix.
DELETE FROM PRODUCT FROM BOOK WHERE BOOK.ID = PRODUCT.BOOK_ID AND BOOK.ID = @BOOK_IDYou just have to make sure you put the table with the FK as the first table in the query.
I guess I should have paid a little more attention in Database class. We learned Oracle, which is different from Microsoft's SQL in many ways.
No comments:
Post a Comment