April 21, 2015 at 5:53 am
I have one 'instead of delete' trigger on one table, which I want to use to control what gets deleted on that table. When I delete records using a script e.g. "delete from MyTable where ID in (1, 2, 3)" the deleted virtual table inside the trigger contains three records. However, if I delete rows directly from the table view (using MS Server Management Studio Edit Rows view), the last record is always omitted from the deleted virtual table in the trigger. I appreciate that I should never delete directly from within a table view, but I want to understand why this would happen? It is always the last record that is missing, no matter how many I delete (unless I delete 1 record which is always included).
April 21, 2015 at 5:59 am
Yes, as you acknowledge, you never quite know what you're getting when you use the GUI, which is a good reason to shy away from it in many circumstances. Have you tried running a trace to find out what is actually happen when you do your delete?
John
April 21, 2015 at 6:09 am
Not entirely sure how to set a trace? Could you point me in the right direction?
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy