各位大侠帮看看,触发器问题
workposition1、workposition2、workposition3是实验台的三个检测工位,每次检测数据自动插入各个检测工位对应的数据库,同车号的车辆多次检测的数据釆用插入的方式存入数据库,同一车号可能有多次检测数据。现要求将workposition1、workposition2、workposition3三个表中,同一车号的最后一次检测数据通过触发器存入report表中对应的字段。
CREATE TABLE [dbo].[P_workposition1] (
[主键] [float] NOT NULL ,
[测试员工号] [char] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[叉车条形码] [char] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[叉车类型] [char] (10) COLLATE Chinese_PRC_CI_AS NULL ,
[前进一档速度] [real] NULL ,
[倒退一档速度] [real] NULL ,
[行进电机稳态电流] [real] NULL ,
[电池电压] [real] NULL ,
[测试时间] [smalldatetime] NOT NULL ,
[备注] [char] (50) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[P_workposition2] (
[主键] [float] NOT NULL ,
[测试员工号] [char] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[叉车条形码] [char] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[叉车类型] [char] (10) COLLATE Chinese_PRC_CI_AS NULL ,
[手左制动力] [real] NOT NULL ,
[手右制动力] [real] NOT NULL ,
[脚左制动力] [real] NOT NULL ,
[脚右制动力] [real] NOT NULL ,
[手制动力和] [real] NOT NULL ,
[脚制动力和] [real] NOT NULL ,
[手制动力差] [real] NOT NULL ,
[脚制动力差] [real] NOT NULL ,
[左阻滞力] [real] NOT NULL ,
[右阻滞力] [real] NOT NULL ,
[测试时间] [datetime] NOT NULL ,
[备注] [char] (50) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[P_workposition3] (
[主键] [float] NOT NULL ,
[测试员工号] [char] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[叉车条形码] [char] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[叉车类型] [char] (10) COLLATE Chinese_PRC_CI_AS NULL ,
[满载门架起升速度] [real] NULL ,
[满载门架下降速度] [real] NULL ,
[起升电机最大电流] [real] NULL ,
[起升电机稳态电流] [real] NULL ,
[转向电机最大电流] [real] NULL ,
[转向电机稳态电流] [real] NULL ,
[测试时间] [datetime] NOT NULL ,
[备注] [char] (50) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[report] (
[forkNo] [char] (50) COLLATE Chinese_PRC_CI_AS NOT NULL , ' [叉车条形码]
[forkType] [char] (10) COLLATE Chinese_PRC_CI_AS NULL , ' [叉车类型]
[tester] [char] (10) COLLATE Chinese_PRC_CI_AS NULL ,