For example, I have a single competition entry for the following people that appears in this Entries table:
EntryID Email EntryDate FirstName LastName
1 firstname.lastname@example.org 12/28/2010 12:23:45 PM Gabriel Markov
2 email@example.com 12/28/2010 12:25:01 PM Marie Smith
3 firstname.lastname@example.org 12/28/2010 12:26:30 PM John Smith
A few minutes later Marie invites 4 of her friends to enter too and so she gets an extra four entries in one go:
4 email@example.com 12/28/2010 12:27:25 PM Marie Smith
5 firstname.lastname@example.org 12/28/2010 12:27:25 PM Marie Smith
6 email@example.com 12/28/2010 12:27:25 PM Marie Smith
7 firstname.lastname@example.org 12/28/2010 12:27:25 PM Marie Smith
My script currently reads her initial entry and uses a cursor to insert new records for each entry. EntryID is an identity fields that auto-increments and the date comes from getdate(), all the other data is duplicated from the original entry.
Marie's friends like to spend their lunch hour online, and so the site gets quite heated for the next hour while her friends enter as well and invite their friends along too. Given the method I'm using, is this the best, or is there a better way that does not use a cursor?