日期:2014-05-17 浏览次数:20532 次
create trigger tri_tb_dataplat_update
on tb_dataplat
for insert
as
begin
insert into PP_CraftData (PP_CraftData_DataPlatID)
select DataID from inserted
end
create trigger tri_tb_dataplat_update
on tb_dataplat
for insert
as
begin
insert into PP_CraftData (DataPlatID) --PP_CraftData_DataPlatID,有这个字段吗?
select DataID from inserted
end
create trigger tri_tb_dataplat_update
on tb_dataplat for insert
as
begin
declare @ID int
select @ID=DataID from tb_dataplat
insert into PP_CraftData(PP_CraftData_DataPlatID) values(@ID)
end
create trigger tri_tb_dataplat_update
on tb_dataplat
for insert
as
BEGIN
insert into PP_CraftData
(
PP_CraftData_DataPlatID
)
SELECT DataID
FROM INSERTED --楼主应该直接从INSERTED表中取ID值
END