I have a simple update query that runs as a job each evening.The query adds information from the Employee Master table to the Employee Leavers Table:
UPDATE EMPLOYEE.dbo.LEAVERS
SET JOB = JOBTITLE
STARTDATE = CONVERT(Char,b.DATEOFJOIN,103)
FROM EMPLOYEE.dbo.LEAVERS a JOIN EMPLOYEE.dbo.MASTER b
ON a.STAFFNO = b.STAFFNO
WHERE LEAVEDATE IS NOT NULL
I would like to create an update trigger to do this as soon as the LEAVEDATE is entered but have no knowledge of triggers. How do I change the code?
UPDATE EMPLOYEE.dbo.LEAVERS
SET JOB = JOBTITLE
STARTDATE = CONVERT(Char,b.DATEOFJOIN,103)
FROM EMPLOYEE.dbo.LEAVERS a JOIN EMPLOYEE.dbo.MASTER b
ON a.STAFFNO = b.STAFFNO
WHERE LEAVEDATE IS NOT NULL
I would like to create an update trigger to do this as soon as the LEAVEDATE is entered but have no knowledge of triggers. How do I change the code?