Danny Ocean (4/19/2013)
Hugo, Question title is "Triggers 1", so everybody look at trigger (even be also). But trick was in "GO"I think question title should be "GO". 🙂
Try what happens if you use a CHECK constraint instead of a trigger to prevent negative values.
By the way, my questions never intentionally contain "tricks". I try to test knowledge. In this case, I focus on how a rollback from a trigger affects a batch.
I realize, from another posters' comment, that the comments in the code were misleading to some. I am really sorry for that. I absolutely do not want to trick people; I want to test their knowledge (and add to it, of course)