我正在尝试运行插入后触发器,但它不起作用,有没有办法查看它的日志?
这是我的代码
ALTER TRIGGER [dbo].[SUBSID_INSERT] on [dbo].[STUDENT_MASTER] AFTER INSERT AS
BEGIN
SET NOCOUNT ON
DECLARE @numrows int, @hostname char(30), @sysuser char(30);
SELECT @numrows = @@rowcount;
IF @numrows = 0 RETURN;
SELECT @hostname = substring(hostname, 1, 30)
FROM master.dbo.sysprocesses
WHERE spid = @@spid;
SELECT @sysuser = substring(system_user, 1, 30);
INSERT INTO insert statement,
FROM STUDENT_MASTER JOIN INSERTED I ON STUDENT_MASTER.ID_NUM = I.ID_NUM
JOIN NAME_MASTER ON NAME_MASTER.ID_NUM = STUDENT_MASTER.ID_NUM
WHERE
STUDENT_MASTER.id_num not in ( select DISTINCT id_num from subsid_master where subsid_cde LIKE '0%')
END
GO