I\'m having trouble understanding the difference between a stored procedure and a trigger in sql. If someone could be kind enough to explain it to me that would be great.
<A stored procedure is a piece of code that resides in and is executed by the DBMS and can be called explicitly by the client or by other stored procedures. It is usually written in a procedural extension of SQL, such as PL/SQL under Oracle or T-SQL under MS SQL Server, but some DBMSes support more general languages such as Java or .NET as well.
A trigger is a (sort of) stored procedure that cannot be called explicitly, and instead executes automatically in response to events such as insertion, update or deletion or rows in a table.