Stored Procedure vs. Triggers

Which one is better when it comes to security and performance?

[113 byte] By [reggiepangilinanX] at [2008-1-7]
# 1

The question is like asking: which is better, a screwdriver or a hammer?

They have very different purposes. For example an application can call a Stored Procedure whereas it cannot call a TRIGGER.

Please be more explicit about what you are hoping to accomplish, and perhaps we can provide you better information.

ArnieRowland at 2007-10-2 > top of Msdn Tech,SQL Server,Getting started with SQL Server...
# 2

As Arnie already told, triggers an procedures are different approaches. E.g., if you know that your application on top of the database is ONLY using the stored procedures to manipulate the data or the business logic is all on the apllication layer and the database is NOT manipulated by other direct talbe manipulation, the you would take the procedures, otherwise not being sure if another application or process changes the data and therefore bypasses the stored procedure, then you would probably use the triggers. There are much more other considerations to take in place, it′s not a this OR that, in many cases a combination of both also makes sense.

Jens K. Suessmeyer

http://www.sqlserver2005.de

JensK.Suessmeyer at 2007-10-2 > top of Msdn Tech,SQL Server,Getting started with SQL Server...

SQL Server

Site Classified