Afficher un message
Vieux 26/03/2008, 06h27   #7
rbr
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Selecting alphanumeric combinations that do not exist already intable?????

Very good. Thank you all very much for the feedback. It is much
appreciated.

Best regards,

rbr




On Mar 25, 4:30 pm, Erland Sommarskog <esq...@sommarskog.se> wrote:
> rbr (ryankbr...@gmail.com) writes:
> > I have considered the speed and space issues. Unfortunately, there are
> > over 14 million usernames currently in use and another 10 million
> > reserved for currently inactive customers. The process of generating
> > names and checking if they are taken is getting tougher. The idea my
> > boss had was to create a table (once) of unused usernames and randomly
> > pick one from the list each time. If this is not feasible (you all
> > make very good points) I would be more than happy to tell him so.
> > However, I figured it would be worth investigating before saying it
> > was impossible.

>
> Impossible it isn't. But it's definitely a waste of disk space.
>
> Even if you have 24 million codes already taken, that's only a little
> more than 1% of the total space consumed, so I think that if every time
> you need a code, generate a random code, check if it is in use this
> should be efficient enough. For about each 10000 customer you will have
> to generate three codes before you have an unused code.
>
> --
> Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se
>
> Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
> Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx



  Réponse avec citation
 
Page generated in 0,21396 seconds with 9 queries