I spent hours searching through Books on Line to learn how to use triggers and didn’t find what I needed there. It may be there, somewhere, in the cryptic language Microsoft likes to couch things in but it certainly wasn’t apparent to me.
I wanted to write a trigger that audited a specific action on a column in a table and I needed to know the previous and updated entry for this column. What BOL didn’t tell me was that the ‘deleted’ variable held the previous value although it did tell me about the ‘inserted’ value which is the new value. This, I discovered in an old SQL Team Introductory article on Triggers by Garth. So it works something like this:
create trigger tr_testtable_mycolumn_update
select @prevint=mycolumn from deleted
select @postint=mycolumn from inserted
… then do stuff like update something in an audit table using @prevint and @postint …
Anyway. Garth’s article helped me to solve my problem, thanks buddy! There are other sources on the net for this kind of information, such as SQLServerCentral.