SQL SERVER – Disadvantages (Problems) of Triggers

August 7, 2013 § 1 Comment

SQL SERVER – Disadvantages (Problems) of Triggers – Pinal Dave

 

One of my team member asked me should I use triggers or stored procedure. Both of them has its usage and needs. I just basically told him few issues with triggers. This is small note about our discussion.

Disadvantages(Problems) of Triggers

  • It is easy to view table relationships , constraints, indexes, stored procedure in database but triggers are difficult to view.
  • Triggers execute invisible to client-application application. They are not visible or can be traced in debugging code.
  • It is hard to follow their logic as it they can be fired before or after the database insert/update happens.
  • It is easy to forget about triggers and if there is no documentation it will be difficult to figure out for new developers for their existence.
  • Triggers run every time when the database fields are updated and it is overhead on system. It makes system run slower.

I do not use triggers. In my whole career I am able to get my work done using Stored Procedures instead of Triggers. (Implementation and Architecture changes are required if either of is to be used to support business logic).

Advertisements

§ One Response to SQL SERVER – Disadvantages (Problems) of Triggers

  • Demerits of Triggers • It is easy to view table relationships , constraints, indexes, stored procedure in database but triggers are difficult to view. • Triggers execute invisible to client-application application. They are not visible or can be traced in debugging code. • It is hard to follow their logic as it they can be fired before or after the database insert/update happens. • It is easy to forget about triggers and if there is no documentation it will be difficult to figure out for new developers for their existence. • Triggers run every time when the database fields are updated and it is overhead on system. It makes system run slower. I do not use triggers. In my whole career I am able to get my work done using Stored Procedures instead of Triggers. (Implementation and Architecture changes are required if either of is to be used to support business logic).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

What’s this?

You are currently reading SQL SERVER – Disadvantages (Problems) of Triggers at Naik Vinay.

meta

%d bloggers like this: