October 23, 2002 07:23 PM

Inserting Records into Two Tables at Once

Rating: (0)
SQL Server Magazine
InstantDoc ID #26856

How can I use one INSERT statement and an INSERT trigger to add records to two tables at the same time?

To add records to two tables at the same time, you need to direct your INSERT statement at the first table. Then, on that table, create an INSERT trigger that uses the inserted table to add records to the second table. Listing 3 shows sample code that performs these operations.

The mo...

...This article is for paid Professional Members only.

Already a Professional Member? Please log in now:

NOT A PROFESSIONAL MEMBER? YOU CHOOSE:

Professional Membership

Monthly

Annual

VIP Membership

Monthly

Annual

Add a Comment

There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here
GOOGLE LINKS
SPONSORED LINKS
FEATURED LINKS