I appreciate it.
Thank you
>Here's the code for an update trigger, using your table and column names. (You'll need to change the reference of "primaryKey" to the name of your primary key column in your inventory table)
>
>Note that the trigger exposes two system tables from the transaction log...DELETED (which contains the row or rows updated to begin with, BEFORE the update), and INSERTED (which contains the row or rows updated, AFTER the update). You join them together, and in the WHERE clause, only use those where the standard cost column has changed. Let me know if this helps...
>
>So yes, you CAN create a trigger on a table, and inside the trigger, update the very table that caused the trigger to fire (and by default, it WON'T "re-fire" the trigger recursively)
>
>
>
>
>CREATE TRIGGER Inventory_Update_Trigger
>ON Inventory
>AFTER UPDATE
>
>AS
>
>BEGIN
>
> UPDATE Inventory
> SET dStndCost = GETDATE()
> FROM Inventory
> JOIN Inserted on Inventory.PrimaryKey = Inserted.PrimaryKey
> JOIN Deleted on Inventory.PrimaryKey = Deleted.PrimaryKey
> WHERE Inserted.nStndCost <> Deleted.nStndCost
>END
>GO
>