- Table #1:
Messages
(PK_ID, Subject, Message) - Table #2: Messages2Members (FK_MessageID, AuthorID, RecipientID)
To handle multiple message recipients (i.e. CC's) my stored procedure first inserts into tbl.Messages
, but to insert into tbl.Messages2Members
, I am unsure if I must create a user-defined table to take the RecipientID
s, then use a cursor or loop - or is there an easier way I am missing?
P.S. SCOPE_IDENTITY()
provides value for newly inserted FK_MessageID
P.S.S. I can research the code myself but just want confirmation of best practice. TIA