ALTER TRIGGER onInsert ON Employee
FOR INSERT
AS
DECLARE @Age INT
DECLARE @message VARCHAR(50)
SET @Age=(SELECT age FROM inserted)
IF(@Age>20 and @Age<50)
BEGIN
INSERT INTO Employee1([Name],Age)
SELECT [Name],Age FROM inserted i
END
ELSE
BEGIN
SELECT @message 'message'
END
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment