CREATE TRIGGER [aplusresulttrig] ON [dbo].[sturesults]
After INSERT
AS
BEGIN
SELECT d.stuid,d.subid,d.result FROM inserted d
if(d.result='a ' or d.result='A ')
INSERT INTO dbo.aplusresult(stuid,subid)
values(d.stuid,d.subid)
END
CodePudding user response:
here is the right syntax :
CREATE TRIGGER [aplusresulttrig] ON [dbo].[sturesults]
After INSERT
AS
BEGIN
INSERT INTO dbo.aplusresult(stuid,subid)
SELECT d.stuid,d.subid
FROM inserted d
WHERE d.result in ('a ','A ')
END