February 22, 2011 at 9:48 pm
business rule: whenever my c#.net applications insert, update or delete an order, it will also automatically insert an "insert", "update", "delete" status in the status table. My question is would it be better to use stored procedure to handle this or can I utilize database trigger for this? Thanks for all the help.
February 22, 2011 at 10:06 pm
A trigger would be better as that would also help you to track if somebody has inserted, updated or deleted an Order from outside your C# Application.
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
February 23, 2011 at 6:44 am
Thanks Kingston. So do I need to create an after insert trigger on the orders table and that trigger would automatically insert a status in the status table?
February 23, 2011 at 10:23 pm
You can create a single trigger for all three operations( INSERT, UPDATE and DELETE )
Inside the trigger you will have write programming logic to INSERT values in Status table based on whichever operation( INSERT or UPDATE or DELETE ) has happened.
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply