Skip to content

Instantly share code, notes, and snippets.

@philoushka
Last active August 24, 2017 13:43
Show Gist options
  • Save philoushka/a694477d99dd0b43d89f to your computer and use it in GitHub Desktop.
Save philoushka/a694477d99dd0b43d89f to your computer and use it in GitHub Desktop.
SQL script to create American/USA states
declare @CountryID int;
select @CountryID = ID
from Country
where CountryCode = 'US';
--load up this country with its states
insert into [State] (CountryID, [Name], Abbr, UtcOffset) values
--load up this country with its states
(@CountryID, 'Alaska', 'AK',-9)
, (@CountryID, 'Alabama', 'AL',-6)
, (@CountryID, 'Arizona', 'AZ',-7)
, (@CountryID, 'Arkansas', 'AR',-6)
, (@CountryID, 'California', 'CA',-8)
, (@CountryID, 'Colorado', 'CO',-7)
, (@CountryID, 'Connecticut', 'CT',-5)
, (@CountryID, 'Delaware', 'DE',-5)
, (@CountryID, 'District of Columbia', 'DC',-5)
, (@CountryID, 'Florida', 'FL',-5)
, (@CountryID, 'Georgia', 'GA',-5)
, (@CountryID, 'Hawaii', 'HI',-10)
, (@CountryID, 'Idaho', 'ID',-7)
, (@CountryID, 'Illinois', 'IL',-6)
, (@CountryID, 'Indiana', 'IN',-5)
, (@CountryID, 'Iowa', 'IA',-6)
, (@CountryID, 'Kansas', 'KS',-6)
, (@CountryID, 'Kentucky', 'KY',-5)
, (@CountryID, 'Louisiana', 'LA',-6)
, (@CountryID, 'Maine', 'ME',-5)
, (@CountryID, 'Maryland', 'MD',-5)
, (@CountryID, 'Massachusetts', 'MA',-5)
, (@CountryID, 'Michigan', 'MI',-5)
, (@CountryID, 'Minnesota', 'MN',-6)
, (@CountryID, 'Mississippi', 'MS',-6)
, (@CountryID, 'Missouri', 'MO',-6)
, (@CountryID, 'Montana', 'MT',-7)
, (@CountryID, 'Nebraska', 'NE',-6)
, (@CountryID, 'Nevada', 'NV',-8)
, (@CountryID, 'New Hampshire', 'NH',-5)
, (@CountryID, 'New Jersey', 'NJ',-5)
, (@CountryID, 'New Mexico', 'NM',-7)
, (@CountryID, 'New York', 'NY',-5)
, (@CountryID, 'North Carolina', 'NC',-6)
, (@CountryID, 'North Dakota', 'ND',-5)
, (@CountryID, 'Ohio', 'OH',-5)
, (@CountryID, 'Oklahoma', 'OK',-6)
, (@CountryID, 'Oregon', 'OR',-8)
, (@CountryID, 'Pennsylvania', 'PA',-5)
, (@CountryID, 'Puerto Rico', 'PR',-5)
, (@CountryID, 'Rhode Island', 'RI',-5)
, (@CountryID, 'South Carolina', 'SC',-5)
, (@CountryID, 'South Dakota', 'SD',-6)
, (@CountryID, 'Tennessee', 'TN',-6)
, (@CountryID, 'Texas', 'TX',-6)
, (@CountryID, 'Utah', 'UT',-7)
, (@CountryID, 'Vermont', 'VT',-5)
, (@CountryID, 'Virginia', 'VA',-5)
, (@CountryID, 'Washington', 'WA',-8)
, (@CountryID, 'West Virginia', 'WV',-5)
, (@CountryID, 'Wisconsin', 'WI',-6)
, (@CountryID, 'Wyoming', 'WY',-7)
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment