CREATE TRIGGER [dbo].[trgAfterDelete12] ON dbo.[project_employee]
AFTER DELETE
AS
declare @empname varchar(25);
declare @emp_password varchar(25);
declare @emp_username varchar(25);
declare @audit_action varchar(50);
select @empname=d.Emp_Name from deleted d;
select @emp_password=d.Emp_Password from deleted d;
select @emp_username=d.Emp_username from deleted d;
set @audit_action=' This employee record has been deleted ';
insert into project_employee_audit(Emp_name,Emp_username,Emp_password,action,update_date)
values(@empname,@emp_username,@emp_password,@audit_action,getdate());
PRINT 'AFTER DELETE Trigger fired.'
GO
这是我已经创建的触发脚本,现在当我尝试再次执行它时,它给了我错误“必须声明一个标量变量,你能告诉我脚本中有什么问题。现在第一次没问题时为什么会这样给我这个错误信息?