This trigger is failing, can anyone see whats wrong?
CREATE TRIGGER [update_status_date] ON [dbo].[NCOS_Data] FOR UPDATE AS Update p SET NC_Status_Date = getdate(), NC_Status_Previous = NC_Status from inserted i join ncos_data p on p.NC_UniqueID = i.NC_UniqueID
Error is: Error 209 Ambiguous column name 'NC_Status'
This trigger is failing, can anyone see whats wrong?
CREATE TRIGGER [update_status_date] ON [dbo].[NCOS_Data] FOR UPDATE AS Update p SET NC_Status_Date = getdate(), NC_Status_Previous = i.NC_Status from inserted i join ncos_data p on p.NC_UniqueID = i.NC_UniqueID
Error is: Error 209 Ambiguous column name 'NC_Status'
The field NC_Status_Date gets the current datetime when the field is changed, and the NC_Status_Previous should get the previous value of NC_Status if it changed.