SQL trigger, how to get the old value for a cell before update in a trigger
Posted on 2012-04-11
I have a AFTER update trigger on my SQL table. ? How do I get the value of a cell, before the update was done.
In the following trigger is it possible to ge the @oldPrmvndr , which is the old value of the column primvndr for the row that was updated.
ALTER TRIGGER [dbo].[trItemQueueUpdate]
declare @newPrmvndr varchar(15)
declare @oldPrmvndr varchar(15)
DECLARE @primvndr varchar(15)
DECLARE @ITEMNMBR varchar(31)
select @ITEMNMBR = itemnmbr, @LOCNCODE = LOCNCODE,@newPrmvndr = primvndr from inserted