I currently have a column called LAST_UPDATED_ON
. Normally when I update something in the query I add to the query the LAST_UPDATED_ON
so something like this:
UPDATE TABLE
SET
COLUMN = :COLUMN,
LAST_UPDATED_ON = NOW()
WHERE ID = :ID
I’m using SQL with Microsoft SQL Server Management Studio.
My question is:
Is there anyway that I could update the column whenever I updated the row without passing it?
Clarification:
I want to be able to write update table set somecolumn = somevalue
and have LAST_UPDATED_ON to be automatically updated to GETDATE().
What I have works, but I’m trying to improve my code day to day.
Current Configuration
7