-
Double Insert UsingTrigger
Hi I am trying insert two lots of data into one table at the same time. I am trying to insert data in table A using a insert command and then using trigger to take data from tabel 'B' which then inserts the data from table B in to table A. Below is my trigger, I cant get the data from table B to be inserted into A at the same time as data is being inserted into table A. Can any one help?
CREATE trigger Tg_Update_WaringData2 on A
for insert
as
insert into A(groups)
select dbo.B.groups
FROM dbo.B INNER JOIN
dbo.A ON dbo.B.vehicle_id = dbo.A.vehicle_id
WHERE (dbo.B.vehicle_id = dbo.A.vehicle_id)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|