Person.StateProvince Table
Information
| Name | StateProvince |
| Schema | Person |
| Row Count | 0 |
| Data Size | |
| Index Size | |
| Reserved Size | |
| Unused Size | |
| Created | 29.3.2010. 21:58:18 |
| Modified | 29.3.2010. 21:58:56 |
Extended Properties
| Name | Type | Property Name | Value |
| StateProvince | TABLE | MS_Description | State and province lookup table. |
Columns
| PK | Key | Identity | Name | Data Type | Allow Nulls | Collation | References | Default | Computed | Compute Expression |
|   |   |   | StateProvinceID | int |   | | | |   | |
| |   |   | StateProvinceCode | nchar(3) |   | SQL_Latin1_General_CP1_CI_AS | | |   | |
| |   |   | CountryRegionCode | nvarchar(3) |   | SQL_Latin1_General_CP1_CI_AS | Person.CountryRegion.CountryRegionCode | |   | |
| |   |   | IsOnlyStateProvinceFlag | bit |   | | | ((1)) |   | |
| |   |   | Name | nvarchar(50) |   | SQL_Latin1_General_CP1_CI_AS | | |   | |
| |   |   | TerritoryID | int |   | | Sales.SalesTerritory.TerritoryID | |   | |
| |   |   | rowguid | uniqueidentifier |   | | | (newid()) |   | |
| |   |   | ModifiedDate | datetime |   | | | (getdate()) |   | |
Indexes
Foreign Key Constraints
SQL Script
CREATE TABLE [Person].[StateProvince] (
[StateProvinceID] int NOT NULL IDENTITY,
[StateProvinceCode] nchar(3) NOT NULL,
[CountryRegionCode] nvarchar(3) NOT NULL,
[IsOnlyStateProvinceFlag] bit NOT NULL DEFAULT ((1)),
[Name] nvarchar(50) NOT NULL,
[TerritoryID] int NOT NULL,
[rowguid] uniqueidentifier NOT NULL DEFAULT (newid()),
[ModifiedDate] datetime NOT NULL DEFAULT (getdate())
);
CREATE UNIQUE INDEX [AK_StateProvince_Name] on [Person].[StateProvince]([Name]);
CREATE UNIQUE INDEX [AK_StateProvince_StateProvinceCode_CountryRegionCode] on [Person].[StateProvince]([StateProvinceCode], [CountryRegionCode]);
CREATE UNIQUE INDEX [AK_StateProvince_rowguid] on [Person].[StateProvince]([rowguid]);