日期:2014-05-18  浏览次数:20564 次

触发器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]