3
Talk guys, next, to with 2 tables (Group1 and Group2), there 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 in the table Group2 the Id of the table Group1 that was just generated in this Save. I saw several things like this using OUTPUT but I don’t know what to do after recovering the value like this. 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>)
I mean, I know how to recover the value but I don’t know how to assign it to the clause of the second Insert. That’s how it would look in the table
- Group1: Group1id, name, age, telephone
- Group 2: name, Group
It is a very simple doubt but I do not find this "final part" to solve the problem, thank you all.
I’ll try when I get home, but how do I use this value to insert into another table? Suggestions?
– Junior