Re: SQL INSERT INTO multiple Tables- HELP!!!

From: Alan Chorozy <achorozy_at_icacomp.com>
Date: 1996/08/27
Message-ID: <4vth3o$mrg_at_master.ftn.net>#1/1


ronjohn_at_communique.net (Ron Johnson, Jr) wrote:

I'm sorry but I don't know about DBKEY and I've looked in the On-line books, I would be interested in knowing about. However another approach maybe the use an insert trigger on Table1 and then loading the values into Table2 with in the trigger. Example:

create table tbl1 (a int identity, b char(2)) go

create table tbl2 (a int, b char(2))
go

create trigger tri_tbl1 on tbl1 for insert as

    insert tbl2 (a,b) select a,b from inserted

return
go

insert tbl1 (b) values ('m')
go

select *
from tbl1
go

select *
from tbl2
go

Results....

a b
----------- --
1 m

(1 row(s) affected)

a b
----------- --
1 m

(1 row(s) affected)

Another approach would be to look at _at__at_IDENTITY. Received on Tue Aug 27 1996 - 00:00:00 CEST

Original text of this message