CodePudding user response:
Can only use the trigger:-=============================================
Author: yenange
- the Create date: 20191019
Description:
-=============================================
CREATE the TRIGGER trig_t_I_U
ON dbo. T
AFTER INSERT, UPDATE
AS
The BEGIN
SET NOCOUNT ON;
IF the EXISTS (
SELECT the FROM 1 t AS A INNER JOIN INSERTED AS B ON Amy polumbo kId!=p. kId
[State]=1 AND a. AND b. [State]=1
AND A.S alesDate=B.S alesDate
)
The BEGIN
The ROLLBACK TRAN.
RAISERROR (' [State]=1 cases are not allowed to repeat the 'SalesDate, 16, 1);
END
END
GO
CodePudding user response:
Thank you, I try