INSERT INTO Table1(group, account)
OUTPUT inserted.Id, B.title, B.amount
INTO Table2(id2, title, amount)
SELECT A.*,
B.title,
B.amount,
B.id2
FROM Table1 AS A
LEFT OUTER JOIN
(SELECT title,
amount,
id2
FROM Table2) AS B
ON A.id = B.id2
i'm stuck with this..i have two join tables
and what i want is to copy the same set of data from table1
to itself and copy the new id of the newly copied data from table1
to table2
column id2
by using OUTPUT
clause.
but now with the query above i cant get through the column that i needed..how can i insert column B.title
& B.amount
to table2
?