我正在尝试在 SQL Server 中创建触发器,但收到错误"Incorrect syntax near the keyword 'user'."



我想从表中的用户中插入数据 Aspnetusers,但我收到此错误 关键字"user"附近的语法不正确 我不知道代码的问题在哪里

create trigger insertdata
ON AspNetUsers
After Insert
as
begin
declare
@userid int,
@userfname nvarchar(50),
@userlname nvarchar(50),
@Usermail nvarchar(50)
select @userid=ClientID,@userfname=FirstName,@userlname=LastName,@Usermail=UserName from AspNetUsers 
insert into user values(@userid,@userfname,@userlname,@Usermail)
end
go
create trigger insertdata
ON final
After Insert
as
begin
declare
@userid int,
@userfname nvarchar(50),
@userlname nvarchar(50),
@Usermail nvarchar(50)
select @userid=ClientID,@userfname=FirstName,@userlname=LastName,@Usermail=UserName from AspNetUsers 
insert into [user] values(@userid,@userfname,@userlname,@Usermail)
end
go

相关内容

  • 没有找到相关文章

最新更新