Triggers for ensuring consistency

I am currently using SQL server transactions to ensure consistent updation of data across multiple tables. My application involves decrementing a value from a row from table A and incrementing the value to a row in table B (Similar to credit/debit in banking scenario).

I know that transactions can ensure consistency. But do I need to do a double check by using triggers to check for updation rules to ensure data consistency?

more ▼

asked Sep 28, 2011 at 07:12 AM in Default

avatar image

13 1 1 3

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

There should be no reason to use triggers to double check.

If you are using transactions from code, or using stored procedures as your data access layer, and you have coded correctly, then there should be no problems.

more ▼

answered Sep 28, 2011 at 07:19 AM

avatar image

Kev Riley ♦♦
66.8k 48 65 81

Thanks Kev.

Sep 28, 2011 at 08:16 PM logicwonder
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Sep 28, 2011 at 07:12 AM

Seen: 903 times

Last Updated: Sep 28, 2011 at 07:12 AM

Copyright 2018 Redgate Software. Privacy Policy