Let's say I have three tables implemented with a many-to-many relationship. Something like: Person (personID), PersonMovies (personID, movieID) and movies (movieID). What is the correct way to make multiple attachments in sql server? I would like to insert a person, films, and then get all the films that a person owns. So will it be three inserts inside a transaction? If this is the case, I would suggest that the easy part inserts a person and a movie into the table, but how do I insert PersonMovies into the table, since this table relies on the existing identifier in the other two tables. I assume that I will insert into Person and Movies, and then somehow assign the identifier of the newly inserted tables to a variable from these two tables, and then use these variables to insert into the bridge table. I have no idea, but I hopethat it makes any sense since I am VERY confused by this !!
user568171
source
share