Foreign key problem

Feb 01, 2008 1 Replies

Ok, I have a situation with an add on. If my table in my add on contains an item id, I want that record to not allow deletion in the RMS manager program. So I added a foreign key which prevents this. Unfortunately, this causes the RMS manager program to interpret this as a fatal error and crashes the program.



Next try: Remove the foreign key. Add a delete trigger that checks for my condition and use RAISEERROR and roll back the transaction if the item is not allowed to be deleted. This has the benefit of me controlling what is in the message box, but the rollback in the trigger is also being interpreted by the manager program as a fatal error and crashing the program.



Are there any reasonably elegant solutions to this problem?


Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required