The following trigger I have wrote to, upon insertion of an Operator name in a record, update the SetHours field with data from another table which contains that operators hours. Tis does not live update, which I would like. It updates when the table is next viewed.
ALTER TRIGGER [dbo].[FindOperatorHours]
ON [dbo].[tblTime]
INSTEAD OF INSERT
AS
BEGIN
INSERT tblTime (SetHours)
SELECT ISNULL(INSERTED.SetHours, tblUser.OperatorHours) AS SetHours
FROM INSERTED
JOIN tblUser ON INSERTED.Operator = tblUser.UserID
END
This coverts all data apart from SetHours to NULL upon re-open of the table, however the value has been fetched correctly? Is it possible to get this to live update, and not convert my data to null?