我需要创建触发器以防止插入和更新到 21 岁以下和 67 岁以上的表员工,代码的下一步是什么?
CREATE TRIGGER allowInsertUpdateemployee ON dbo.employee
AFTER UPDATE, INSERT
AS
BEGIN
DECLARE @v_ageLow INT = 21,
@v_ageHigh INT = 67,
@v_dateLow date,
@v_dateHigh date
SET @v_dateLow = DATEADD(YEAR, -1 * @v_ageLow, GETDATE())
SET @v_dateHigh = DATEADD(YEAR, -1 * @v_ageHigh, GETDATE())
END