Wiki

Case Status Kiln
Log In

Wiki

 
Procedures»Create State database table
  • RSS Feed

Last modified on 11/27/2013 10:12 AM by User.

Tags:

Create State database table

This script is for SQL Server and includes the District of Columbia as a state.

 

CREATE TABLE States (

StateId int CONSTRAINT pkStates PRIMARY KEY IDENTITY,

Name nvarchar(20) CONSTRAINT StatesNameUnique UNIQUE NOT NULL,

Abbreviation nvarchar(2) CONSTRAINT StatesValueUnique UNIQUE NOT NULL

)

GO

INSERT INTO STATES (Name, Abbreviation) VALUES ('New York', 'NY');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Alabama', 'AL');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Alaska', 'AK');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Arizona', 'AZ');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Arkansas', 'AR');

INSERT INTO STATES (Name, Abbreviation) VALUES ('California', 'CA');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Colorado', 'CO');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Connecticut', 'CT');

INSERT INTO STATES (Name, Abbreviation) VALUES ('District of Columbia', 'DC');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Delaware', 'DE');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Florida', 'FL');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Georgia', 'GA');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Hawaii', 'HI');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Idaho', 'ID');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Illinois', 'IL');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Indiana', 'IN');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Iowa', 'IA');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Kansas', 'KS');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Kentucky', 'KY');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Louisiana', 'LA');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Maine', 'ME');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Maryland', 'MD');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Massachusetts', 'MA');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Michigan', 'MI');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Minnesota', 'MN');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Mississippi', 'MS');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Missouri', 'MO');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Montana', 'MT');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Nebraska', 'NE');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Nevada', 'NV');

INSERT INTO STATES (Name, Abbreviation) VALUES ('New Hampshire', 'NH');

INSERT INTO STATES (Name, Abbreviation) VALUES ('New Jersey', 'NJ');

INSERT INTO STATES (Name, Abbreviation) VALUES ('New Mexico', 'NM');

INSERT INTO STATES (Name, Abbreviation) VALUES ('North Carolina', 'NC');

INSERT INTO STATES (Name, Abbreviation) VALUES ('North Dakota', 'ND');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Ohio', 'OH');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Oklahoma', 'OK');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Oregon', 'OR');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Pennsylvania', 'PA');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Rhode Island', 'RI');

INSERT INTO STATES (Name, Abbreviation) VALUES ('South Carolina', 'SC');

INSERT INTO STATES (Name, Abbreviation) VALUES ('South Dakota', 'SD');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Tennessee', 'TN');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Texas', 'TX');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Utah', 'UT');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Vermont', 'VT');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Virginia', 'VA');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Washington', 'WA');

INSERT INTO STATES (Name, Abbreviation) VALUES ('West Virginia', 'WV');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Wisconsin', 'WI');

INSERT INTO STATES (Name, Abbreviation) VALUES ('Wyoming', 'WY');

GO