当前位置: 代码迷 >> Sql Server >> 触发器insert解决办法
  详细解决方案

触发器insert解决办法

热度:76   发布时间:2016-04-27 13:46:41.0
触发器insert
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go


ALTER TRIGGER [SPCUSRDATA]
  ON [dbo].[Usr]
  AFTER INSERT
AS 
BEGIN
INSERT INTO dbo.SPCUserLog
  ([spcusrId]
  ,[usrCode]  
  ,[usrName]
  ,[colInfId]
  )
 SELECT 
  [usrId]
  [usrCode]  
  ,[usrName]
  ,[colInfId]
   

  
 FROM INSERTED

END



------解决方案--------------------
少了个逗号
ALTER TRIGGER [SPCUSRDATA]
ON [dbo].[Usr]
AFTER INSERT
AS
BEGIN
INSERT INTO dbo.SPCUserLog
([spcusrId]
,[usrCode]
,[usrName]
,[colInfId]
)
 SELECT
[usrId]
,[usrCode]
,[usrName]
,[colInfId]
  相关解决方案