触发器不会触发。一个asp.net应用程序试图插入一个记录,该记录应该触发此触发器,但它无法触发。使用Windows 2008R2,框架4.5。这是触发器:
ALTER TRIGGER [dbo].[trgAfterInsert] ON [dbo].[AspNetUsers]
with execute as owner
FOR INSERT
AS
declare @email nvarchar(128),
@ID nvarchar(128)
select @email = i.Email,
@ID = i.Id
from inserted i;
insert into LoginHistory
([Email],[LoginID])
Values
(@email, @ID)
insert into AspNetUserRoles
(userID,RoleID)
select @ID, AspNetRoleID from ConfirmedRoles
where email = @email
在
上运行alter database TestDB set trustedworthy