Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /homepages/10/d214220746/htdocs/thecrankydba/wp-content/plugins/jetpack/_inc/lib/class.media-summary.php on line 77

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /homepages/10/d214220746/htdocs/thecrankydba/wp-content/plugins/jetpack/_inc/lib/class.media-summary.php on line 87
Yankee Swap Number Generator | Mike Hillwig
Warning: count(): Parameter must be an array or an object that implements Countable in /homepages/10/d214220746/htdocs/thecrankydba/wp-includes/post-template.php on line 284

Yankee Swap Number Generator


December 17, 2012 by Mike Hillwig

Like many companies, we have a lunch around this time of year where we exchange gifts. In my office, we do what’s called a Yankee Swap. This always means drawing numbers from a hat.

Somehow, this has become problematic in my office and nobody wants to be responsible managing the numbers. As I’ve said to many an intern in the past, “I can replace you with a SQL script.” And that’s just what I did here. Β Now, this is hardly an example of good code. I’m breaking the golden rule by putting a clustered index on a GUID. And worse yet, I’m sorting on a substring of a GUID. But I will submit that it’s still more random than pulling numbers from a hat, which allows people to cheat.

CREATE TABLE #ys_users


INSERT #ys_users (PERSON) VALUES ('Tina')
INSERT #ys_users (PERSON) VALUES ('Chris')
INSERT #ys_users (PERSON) VALUES ('Jim')
INSERT #ys_users (PERSON) VALUES ('Mike')
INSERT #ys_users (PERSON) VALUES ('Cheryl')
INSERT #ys_users (PERSON) VALUES ('Tim')


DROP TABLE #ys_users

You can run this script over and over, and you will get a different result each time. Β The results will look something like this.

  • Brian K

    Or just sort by NEWID() and save the storage of six GUIDs.

  • I never said it was good. I said it was random. πŸ™‚

  • Pingback: Something for the Weekend - SQL Server Links 11/01/13()

  • Suse, das stimmt, meistens kommen mehr neue Liebschaften hinzu, als man sich alter entledigt.Christina, Honig-Salz-Nüsse kânnten mir auch munden…Isi, freut mich.

  • אנ×Âℒ לא Γƒβ€”Γ‚β„’Γƒβ€”Γ‚β€’Γƒβ€”Γ‚β€œΓƒβ€”Γ‚Β’ כמה מהכ×ÂΒͺΓƒβ€”Γ‚β€˜Γƒβ€”Γ‚β€ נכ×Â‒נה Γƒβ€”Γ‚β€ΊΓƒβ€”Γ‚β„’ Γƒβ€”Γ‚Ε“Γƒβ€”Γ‚β€ΊΓƒβ€”Γ‚β€’Γƒβ€”Γ‚ΒͺΓƒβ€”Γ‚β€˜Γƒβ€”Γ‚β„’Γƒβ€”Γ‚Β ×Âℒש Γƒβ€”Γ‚Β Γƒβ€”Γ‚ΛœΓƒβ€”Γ‚β„’Γƒβ€”Γ‚β„’Γƒβ€”Γ‚β€ להגז×Âℒם Γƒβ€”Γ‚ΒΓƒβ€”Γ‚β€˜Γƒβ€”Γ‚Ε“ ככה אנ×Âℒ Γƒβ€”Γ‚β€”Γƒβ€”Γ‚β€’Γƒβ€”Γ‚Β©Γƒβ€”Γ‚β€˜ שלא צר×Âℒ×Âő לגש×Â‒×ÂΒͺ Γƒβ€”Γ‚ΛœΓƒβ€”Γ‚Β’Γƒβ€”Γ‚β€’Γƒβ€”Γ‚β„’Γƒβ€”Γ‚β€’Γƒβ€”Γ‚Βͺ צר×Âℒ×Âő Γƒβ€”Γ‚Ε“Γƒβ€”Γ‚β€œΓƒβ€”Γ‚β€˜Γƒβ€”Γ‚Β¨ אם Γƒβ€”Γ‚β„’Γƒβ€”Γ‚Ε“Γƒβ€”Γ‚β€œΓƒβ€”Γ‚β„’Γƒβ€”Γ‚Β גל בקב מ×Â‒גן Γƒβ€”Γ‚β€ΊΓƒβ€”Γ‚β„’ ה×Â‒א ק×Â‒רה Γƒβ€”Γ‚β€ΊΓƒβ€”Γ‚Ε‘ א×Â‒ Γƒβ€”Γ‚β€ΊΓƒβ€”Γ‚Ε‘ Γƒβ€”Γ‚Βͺ׀ב×Âℒק×Â‒ לה×ÂΒͺכחש ה×Â‒ר×Âℒם .אל×Â‒ק×Âℒם × ×Â‒×ÂΒͺΓƒβ€”Γ‚ΕΈ ×Â‒ל×Â‒קח נראה לכם ב×ÂΒͺם Γƒβ€”Γ‚ΒΓƒβ€”Γ‚β€˜Γƒβ€”Γ‚Β‘Γƒβ€”Γ‚β€’Γƒβ€”Γ‚Β¨Γƒβ€”Γ‚β€œ שהאח×ÂΒͺ ה×Â‒לכ×ÂΒͺ לגש×Â‒×ÂΒͺ ה׀לה ×Â‒השנ×Âℒ×Âℒה Γƒβ€”Γ‚Ε“Γƒβ€”Γ‚ΛœΓƒβ€”Γ‚β„’Γƒβ€”Γ‚Β€Γƒβ€”Γ‚β€’Γƒβ€”Γ‚Ε“Γƒβ€”Γ‚β„’ ׀×Â‒ר×Âℒ×Â‒×ÂΒͺ זא×ÂΒͺ לא Γƒβ€”Γ‚β€Γƒβ€”Γ‚β€Γƒβ€”Γ‚β€”Γƒβ€”Γ‚Ε“Γƒβ€”Γ‚ΛœΓƒβ€”Γ‚β€ שלנ×Â‒ ה×Â‒א Γƒβ€”Γ‚Β§Γƒβ€”Γ‚β€’Γƒβ€”Γ‚β€˜Γƒβ€”Γ‚Β’ Γƒβ€”Γ‚ΒͺΓƒβ€”Γ‚Ε“Γƒβ€”Γ‚ΕΎΓƒβ€”Γ‚β€œΓƒβ€”Γ‚β€’ Γƒβ€”Γ‚Ε“Γƒβ€”Γ‚Β§Γƒβ€”Γ‚β€˜Γƒβ€”Γ‚Ε“ הכל Γƒβ€”Γ‚β€˜Γƒβ€”Γ‚ΒΓƒβ€”Γ‚β€Γƒβ€”Γ‚β€˜Γƒβ€”Γ‚β€

  • @Icebergfinanza. Profumo e’ un banchiere di fiducia del pd, vogliono la patrimoniale per procurarsi un tesoretto onde avere un buon retratto per soddisfare le proprie clientele nazionali ed estere. Terza repubblica come la prima e seconda ma con molte piu’ tasse. Il pd finita l’urss, si e’ velocemente inteso con nuovi soggetti…esteri. Il problema (il nostro problema) e’ che il vecchio DAVA (rubli), il nuovo PRENDE (tanti euro).

  • luis scrive:Concordo, ma non dimenticarti delle maul come le ha lasciate giocare ! Partita vinta con il cuore ma in quanto a gioco non ci siamo , soprattutto quando si attacca con i trequarti. Di bernardo -non da oggi- ha grande calcio, difende molto bene e quando serve va drittoperdritto, in questo momento molto meglio di Burton e ti dirò di più: più gioca e più migliora a mio avviso. Dietro manca l’imprevedibilità di Dingo, l’esperienza e la solidità di LaGrange e la forza di Loamanu.La fase difensiva invece la facciamo molto bene.

  • Keising, as a teen suffering with Gynecomastia, spent all of his free time trying to figure out how to get rid of man boobs without spending thousands of dollars on surgery or drugs. Now, several years later, he continues

  • Je n’ai pas dit que je préférais ΓƒΒͺtre ensablé, Ange. J’ai dit que j’avais un imaginaire du désert, du vent, des sables du désert. J’aime aussi les gouttes de mer mais dans d’autres circonstances… la mer que je porte en moi…