Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to check for error in a trigger?
Message
 
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01520325
Message ID:
01520331
Views:
27
>>>My UI is built in such a way that only one row can be deleted from the parent table anyway. But I will see if I still should add your code that check and raises the error.
>>>
>>>As far as my original question. Are you saying that if any UPDATE CHILD in my trigger fails the SQL Server will raise an error anyways? What if update of CHILD 3 fails, will SQL Server roll back the changes to the CHILD 1 and 2?
>>>
>>>Thank you.
>>
>>The best way is to try and test. Without testing I'm guessing that none of the updates will take place is one of the updates fail.
>
>I agree with you; this is the right way. I just need to learn how to make one of the child updates to fail :). Thank you.

Very simple. Add for now updating one of the fields that doesn't allow NULL with NULL.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform