What I Do:
I have a table with a field for an unique ID, a varchar field(50) for a GUID value and a field for the user id
I have a checkboxlist in which I can select users. When clicking a submit button I do:
- create a New Guid()
- scan for all checked checkboxes.
Each checkbox and the guid are stored in table.
After that I call an stored procedure that has the Guid as input parameter
In that stored procedure I can
select m.Message
from tblMessage as m
inner join zzzTestQuery1 as z on z.mId = m.mid
where z.uid in (select uid from myTable where guidField = @guid)
By using the guid you have one unique reference to the messages form the selected users.
Have fun