ALTER TRIGGER [dbo].[AlertMail_tr]
ON
[dbo].[MethodToLog_tbl]
AFTER INSERT
AS
BEGIN
DECLARE @LogId int
SET @LogId = (SELECT LogDataId FROM inserted)
if(SELECT Failure_flag FROM inserted)=1
begin
exec [DB].[dbo].SendMail_prc
@Command='EXEC CheckNew.dbo.FailureMail_prc @LogId'
,@MailPriority=1
,@MailRecipients='abc@xyz.com'
,@Subject='Alert-Failure'
end
END
我收到此错误:
必须声明标量变量@LogId。