Jasinski Technical Wiki

Navigation

Home Page
Index
All Pages

Quick Search
»
Advanced Search »

Contributor Links

Create a new Page
Administration
File Management
Login/Logout
Your Profile

Other Wiki Sections

Software

PoweredBy

Randomly Generate a List of Names - SQL Server

RSS
Modified on Tue, Sep 25, 2012, 2:46 PM by Administrator Categorized as SQL Server
with FirstName as (
    select s = 'James', Gender='M'
    union select 'John', 'M'
    union select 'Robert', 'M'
    union select 'Michael', 'M'
    union select 'William', 'M'
    union select 'David', 'M'
    union select 'Richard', 'M'
    union select 'Charles', 'M'
    union select 'Joseph', 'M'
    union select 'Thomas', 'M'
    union select 'Christopher', 'M'
    union select 'Daniel', 'M'
    union select 'Paul', 'M'
    union select 'Mark', 'M'
    union select 'Donald', 'M'
    union select 'George', 'M'
    union select 'Kenneth', 'M'
    union select 'Steven', 'M'
    union select 'Edward', 'M'
    union select 'Brian', 'M'
    union select 'Ronald', 'M'
    union select 'Anthony', 'M'
    union select 'Kevin', 'M'
    union select 'Jason', 'M'
    union select 'Matthew', 'M'
    union select 'Gary', 'M'
    union select 'Timothy', 'M'
    union select 'Jose', 'M'
    union select 'Larry', 'M'
    union select 'Jeffrey', 'M'
    union select 'Frank', 'M'
    union select 'Scott', 'M'
    union select 'Eric', 'M'
    union select 'Stephen', 'M'
    union select 'Andrew', 'M'
    union select 'Raymond', 'M'
    union select 'Gregory', 'M'
    union select 'Joshua', 'M'
    union select 'Jerry', 'M'
    union select 'Dennis', 'M'
    union select 'Walter', 'M'
    union select 'Patrick', 'M'
    union select 'Peter', 'M'
    union select 'Harold', 'M'
    union select 'Douglas', 'M'
    union select 'Henry', 'M'
    union select 'Carl', 'M'
    union select 'Arthur', 'M'
    union select 'Ryan', 'M'
    union select 'Roger', 'M'
    
    union select 'Mary', 'F'
    union select 'Patricia', 'F'
    union select 'Linda', 'F'
    union select 'Barbara', 'F'
    union select 'Elizabeth', 'F'
    union select 'Jennifer', 'F'
    union select 'Maria', 'F'
    union select 'Susan', 'F'
    union select 'Margaret', 'F'
    union select 'Dorothy', 'F'
    union select 'Lisa', 'F'
    union select 'Nancy', 'F'
    union select 'Karen', 'F'
    union select 'Betty', 'F'
    union select 'Helen', 'F'
    union select 'Sandra', 'F'
    union select 'Donna', 'F'
    union select 'Carol', 'F'
    union select 'Ruth', 'F'
    union select 'Sharon', 'F'
    union select 'Michelle', 'F'
    union select 'Laura', 'F'
    union select 'Sarah', 'F'
    union select 'Kimberly', 'F'
    union select 'Deborah', 'F'
    union select 'Jessica', 'F'
    union select 'Shirley', 'F'
    union select 'Cynthia', 'F'
    union select 'Angela', 'F'
    union select 'Melissa', 'F'
    union select 'Brenda', 'F'
    union select 'Amy', 'F'
    union select 'Anna', 'F'
    union select 'Rebecca', 'F'
    union select 'Virginia', 'F'
    union select 'Kathleen', 'F'
    union select 'Pamela', 'F'
    union select 'Martha', 'F'
    union select 'Debra', 'F'
    union select 'Amanda', 'F'
    union select 'Stephanie', 'F'
    union select 'Carolyn', 'F'
    union select 'Christine', 'F'
    union select 'Marie', 'F'
    union select 'Janet', 'F'
    union select 'Catherine', 'F'
    union select 'Frances', 'F'
    union select 'Ann', 'F'
    union select 'Joyce', 'F'
    union select 'Diane', 'F'
    )
,LastName as (
    select s = 'Smith'
    union select 'Johnson'
    union select 'Williams'
    union select 'Brown'
    union select 'Jones'
    union select 'Miller'
    union select 'Davis'
    union select 'Garcia'
    union select 'Rodriguez'
    union select 'Wilson'
    union select 'Martinez'
    union select 'Anderson'
    union select 'Taylor'
    union select 'Thomas'
    union select 'Hernandez'
    union select 'Moore'
    union select 'Martin'
    union select 'Jackson'
    union select 'Thompson'
    union select 'White'
    union select 'Lopez'
    union select 'Lee'
    union select 'Gonzalez'
    union select 'Harris'
    union select 'Clark'
    union select 'Lewis'
    union select 'Robinson'
    union select 'Walker'
    union select 'Perez'
    union select 'Hall'
    union select 'Young'
    union select 'Allen'
    union select 'Sanchez'
    union select 'Wright'
    union select 'King'
    union select 'Scott'
    union select 'Green'
    union select 'Baker'
    union select 'Adams'
    union select 'Nelson'
    union select 'Hill'
    union select 'Ramirez'
    union select 'Campbell'
    union select 'Mitchell'
    union select 'Roberts'
    union select 'Carter'
    union select 'Phillips'
    union select 'Evans'
    union select 'Turner'
    union select 'Torres'
    union select 'Parker'
    union select 'Collins'
    union select 'Edwards'
    union select 'Stewart'
    union select 'Flores'
    union select 'Morris'
    union select 'Nguyen'
    union select 'Murphy'
    union select 'Rivera'
    union select 'Cook'
    union select 'Rogers'
    union select 'Morgan'
    union select 'Peterson'
    union select 'Cooper'
    union select 'Reed'
    union select 'Bailey'
    union select 'Bell'
    union select 'Gomez'
    union select 'Kelly'
    union select 'Howard'
    union select 'Ward'
    union select 'Cox'
    union select 'Diaz'
    union select 'Richardson'
    union select 'Wood'
    union select 'Watson'
    union select 'Brooks'
    union select 'Bennett'
    union select 'Gray'
    union select 'James'
    union select 'Reyes'
    union select 'Cruz'
    union select 'Hughes'
    union select 'Price'
    union select 'Myers'
    union select 'Long'
    union select 'Foster'
    union select 'Sanders'
    union select 'Ross'
    union select 'Morales'
    union select 'Powell'
    union select 'Sullivan'
    union select 'Russell'
    union select 'Ortiz'
    union select 'Jenkins'
    union select 'Gutierrez'
    union select 'Perry'
    union select 'Butler'
    union select 'Barnes'
    union select 'Fisher'
    )
select top 100

     FirstName = FirstName.s
    ,LastName  = LastName.s
    ,FirstName.Gender
from
     FirstName
    ,LastName
order by 
    NEWID()

ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.