|
|
|
SSChampion
        
Group: General Forum Members
Last Login: Yesterday @ 5:34 PM
Points: 11,784,
Visits: 28,041
|
|
UPDATE [table] SET [col] = [col]
Seriously? that is the trigger body? updating the column to itself, with referencing the INSERTED virtual table?
Remember we are not in your cube looking over your shoulder; we can only help you if you help us by providing the complete, real update command.
there's got to be much much more than you are telling us, because base don what I've seen so far, it seems you are trying to do something like this:
UPDATE PROD SET Product_Name_Expiry = getdate() WHERE Product_Name_Expiry IS NULL
that is the most basic of UPDATE commands, and your trigger must be more complex than the code you pasted, otherwise you wouldn't need a trigger at all.
Lowell
--There is no spoon, and there's no default ORDER BY in sql server either. Actually, Common Sense is so rare, it should be considered a Superpower. --my son
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 5:02 AM
Points: 403,
Visits: 904
|
|
Lowell (12/20/2012) UPDATE [table] SET [col] = [col]
Seriously? that is the trigger body? updating the column to itself, with referencing the INSERTED virtual table?
It's not the trigger body... is the sql statement to fire the trigger on the table...
Try changing the AFTER INSERT, UPDATE to FOR INSERT, UPDATE.
The UPDATE table SET col = col should fire the trigger, I use it often when I want to do exactly what your're trying to accomplish..
If you need to work better, try working less...
|
|
|
|