Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
BitShift
Yak Posting Veteran
98 Posts |
Posted - 2007-05-30 : 12:16:39
|
I need to provide a way to handle groups that buy tickets in bulk lots, say 20 at a time. Users can later register with a "ticket code". I need to tie these two together and provide a way for groups to buy more tickets at a later time.There should be a code that can be generated for each ticket that a group buys. This ticket is then to be given to a user to register with. A rogue user should not find it easy to guess the code. So, I want to generate a code for each group as they register, that is a random 6 or 7 digit, alphanumeric string and then something similar for a ticket. See table definitions below. So for a ticket code, we could have something like this:A23486D_TR34, where A23486D would be the group codecomments/suggestions/ideas welcomeAt present Ive built two tables, [groups] and [group_tickets][group]id int(10) unsignedname varchar(45)phone varchar(10)email varchar(45)contact_name varchar(100)signup_date datetimelast_update datetimegroup_code varchar(6)addr1 varchar(45)addr2 varchar(45)city varchar(45)state char(2)zip varchar(10)[group_ticket]id int(10) unsignedgroup_id int(10) unsignedpurchase_date datetimefill_date datetimeticket_notes textticket_code varchar(12) |
|
chrisrock
Starting Member
12 Posts |
Posted - 2007-06-12 : 08:48:44
|
Have you looked into using guids (uniqueidentifier)? It's really hard to guess those! |
 |
|
|
|
|