Next, talk with 2 tables (Group1 and Group2), so I have a form that has several fields that will be inserted at the same time in these 2 tables. But I need to insert into the Group2 table the Id of the Group1 table that was just generated in that Save. I saw several things like that using the OUTPUT but I do not know what to do after recovering the value like that. What I need would be more or less this
insert into Grupo1
values (nome, idade, telefone)
output inserted.Grupo1Id // aqui é o valor que quero
insert into grupo2
values (<inserted.Grupo1Id>)
That is, I know how to retrieve the value but I do not know how to assign it to the second Insert clause. It would look like this in the table
- Group1: Group1Id, name, age, phone
- Group2: name, GroupIdIgualAboutLimitLine
It's a simple question, but I do not think that's the "end" to solve the problem, thanks to everyone.