要点小毛病 求指点
create trigger tri_tb_dataplat_update
on tb_dataplat
for insert
as
declare @ID int
select @ID= DataID from tb_dataplat
insert into PP_CraftData(PP_CraftData_DataPlatID)values(@ID
两个表名(tri_tb_dataplat PP_CraftData) 字段名 DataPlatID DataID
哪错了 求指点
快呀 select as
[解决办法]
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