V
V
vbif2017-09-14 12:44:39
SQL Server
vbif, 2017-09-14 12:44:39

How to insert query result into two related tables?

For a single entry, I can get the last id via scope_identity() . But I need to insert records from one large table into two others - what can I do in this case?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
d-stream, 2017-09-14
@d-stream

What is the relationship between the first and second sentence?
What is the essence of the insert and why does it not work?
"at the same time" it is required to place id of freshly inserted lines in that big table???

A
Artyom Karetnikov, 2017-09-14
@art_karetnikov

You need to read about Output. Sooo simple.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question