Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HOWTO INSERT INTO USING JOIN TO MORE THAN ONE TABLE?

0 views
Skip to first unread message

stoc...@onebox.com

unread,
Nov 7, 2000, 3:00:00 AM11/7/00
to
If I have two tables: Table1 and Table2
Is it possible to insert values into both tables using one sql statement?
ex:
insert into table1 values (1,2,3) INNER JOIN table2 values (4,5,6) where
table1.pk = table2.fk

--
Posted via CNET Help.com
http://www.help.com/

PDBA

unread,
Nov 7, 2000, 3:00:00 AM11/7/00
to
I don't think it is possible.

I think you can insert into only one table at a time.

<stoc...@onebox.com>이(가) 아래 메시지를
news:t0h4455...@corp.supernews.com에 게시하였습니다.

Thomas R. Hummel

unread,
Nov 9, 2000, 3:00:00 AM11/9/00
to
It might be possible in SQL Server 2000 using an updatable view. Can
anyone who's using 2000 verify this?

Thanks,
-Tom.

In article <t0h4455...@corp.supernews.com>,


<stoc...@onebox.com> wrote:
> If I have two tables: Table1 and Table2
> Is it possible to insert values into both tables using one sql
statement?
> ex:
> insert into table1 values (1,2,3) INNER JOIN table2 values (4,5,6)
where
> table1.pk = table2.fk
>
> --
> Posted via CNET Help.com
> http://www.help.com/
>


Sent via Deja.com http://www.deja.com/
Before you buy.

Dan Guzman

unread,
Nov 15, 2000, 3:00:00 AM11/15/00
to
With SQL 2000, you can create an INSTEAD OF trigger on the view. The
trigger code can do anything you want, including INSERTs into multiple
tables.


Hope this helps.

"Thomas R. Hummel" <tom_h...@my-deja.com> wrote in message
news:8uej7k$db$1...@nnrp1.deja.com...

0 new messages