Difference between revisions of "Person.StateProvince (table)"

From dbscript Online Help
Jump to: navigation, search
 
(7 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
|-
+
|- valign="top"
 
| '''Table
 
| '''Table
 
| Person.StateProvince
 
| Person.StateProvince
|-
+
|- valign="top"
 +
| '''Description
 +
| State and province lookup table.
 
|}
 
|}
  
 
+
=== Columns ===
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 
|- style="background:silver"
 
|- style="background:silver"
Line 15: Line 17:
 
| '''Nullable
 
| '''Nullable
 
| '''Default
 
| '''Default
| '''PK
+
| '''Description
| '''Index
+
 
+
|- valign="top"
|-
 
 
| StateProvinceID
 
| StateProvinceID
 
| int
 
| int
 
| not null
 
| not null
 
|  
 
|  
| PK_StateProvince_StateProvinceID
+
| Primary key for StateProvince records.
|
+
|- valign="top"
|-
 
 
| StateProvinceCode
 
| StateProvinceCode
 
| nchar(3)
 
| nchar(3)
 
| not null
 
| not null
 
|  
 
|  
|  
+
| ISO standard state or province code.
| AK_StateProvince_StateProvinceCode_CountryRegionCode
+
|- valign="top"
|-
 
 
| CountryRegionCode
 
| CountryRegionCode
 
| nvarchar(3)
 
| nvarchar(3)
 
| not null
 
| not null
 
|  
 
|  
|  
+
| ISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode.
| AK_StateProvince_StateProvinceCode_CountryRegionCode
+
|- valign="top"
|-
 
 
| IsOnlyStateProvinceFlag
 
| IsOnlyStateProvinceFlag
 
| dbo.Flag
 
| dbo.Flag
 
| not null
 
| not null
 
| ((1))
 
| ((1))
|  
+
| 0 = StateProvinceCode exists. 1 = StateProvinceCode unavailable, using CountryRegionCode.
|
+
|- valign="top"
|-
 
 
| Name
 
| Name
 
| dbo.Name
 
| dbo.Name
 
| not null
 
| not null
 
|  
 
|  
|  
+
| State or province description.
| AK_StateProvince_Name
+
|- valign="top"
|-
 
 
| TerritoryID
 
| TerritoryID
 
| int
 
| int
 
| not null
 
| not null
 
|  
 
|  
|  
+
| ID of the territory in which the state or province is located. Foreign key to SalesTerritory.SalesTerritoryID.
|
+
|- valign="top"
|-
 
 
| rowguid
 
| rowguid
 
| uniqueidentifier
 
| uniqueidentifier
 
| not null
 
| not null
 
| (newid())
 
| (newid())
|  
+
| ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
| AK_StateProvince_rowguid
+
|- valign="top"
|-
 
 
| ModifiedDate
 
| ModifiedDate
 
| datetime
 
| datetime
 
| not null
 
| not null
 
| (getdate())
 
| (getdate())
|  
+
| Date and time the record was last updated.
|  
+
|}
 +
 
 +
=== Primary Key ===
 +
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 +
|- style="background:silver"
 +
| '''Primary Key
 +
| '''Columns
 +
|- valign="top"
 +
| PK_StateProvince_StateProvinceID
 +
| StateProvinceID
 
|}
 
|}
  
 +
=== Indexes ===
 +
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 +
|- style="background:silver"
 +
| '''Index
 +
| '''Type
 +
| '''Columns
  
 +
|- valign="top"
 +
| AK_StateProvince_Name
 +
| Unique
 +
| Name
 +
|- valign="top"
 +
| AK_StateProvince_rowguid
 +
| Unique
 +
| rowguid
 +
|- valign="top"
 +
| AK_StateProvince_StateProvinceCode_CountryRegionCode
 +
| Unique
 +
| StateProvinceCode, CountryRegionCode
 +
|}
  
 +
=== Foreign Keys ===
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 
|- style="background:silver"
 
|- style="background:silver"
Line 83: Line 106:
 
| '''Column
 
| '''Column
 
| '''Referenced Column
 
| '''Referenced Column
+
 
|-
+
|- valign="top"
 
| [[Person.CountryRegion_(table)|Person.CountryRegion]]
 
| [[Person.CountryRegion_(table)|Person.CountryRegion]]
 
| CountryRegionCode
 
| CountryRegionCode
 
| CountryRegionCode
 
| CountryRegionCode
|-
+
|- valign="top"
 
| [[Sales.SalesTerritory_(table)|Sales.SalesTerritory]]
 
| [[Sales.SalesTerritory_(table)|Sales.SalesTerritory]]
 
| TerritoryID
 
| TerritoryID
Line 94: Line 117:
 
|}
 
|}
  
 
+
=== Detail Tables ===
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 
|- style="background:silver"
 
|- style="background:silver"
Line 100: Line 123:
 
| '''Column
 
| '''Column
 
| '''Referencing Column
 
| '''Referencing Column
+
 
|-
+
|- valign="top"
 
| [[Person.Address_(table)|Person.Address]]
 
| [[Person.Address_(table)|Person.Address]]
 
| StateProvinceID
 
| StateProvinceID
 
| StateProvinceID
 
| StateProvinceID
|-
+
|- valign="top"
 
| [[Sales.SalesTaxRate_(table)|Sales.SalesTaxRate]]
 
| [[Sales.SalesTaxRate_(table)|Sales.SalesTaxRate]]
 
| StateProvinceID
 
| StateProvinceID
 
| StateProvinceID
 
| StateProvinceID
 
|}
 
|}
 +
 +
=== References ===
 +
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 +
|- style="background:silver"
 +
| '''Dependency Type
 +
| '''Object Type
 +
| '''Referenced Object
 +
 +
|- valign="top"
 +
| Data Type
 +
| Type
 +
| [[dbo.Flag_(type)|dbo.Flag]]
 +
 +
|- valign="top"
 +
| Data Type
 +
| Type
 +
| [[dbo.Name_(type)|dbo.Name]]
 +
 +
|- valign="top"
 +
| Schema
 +
| Schema
 +
| [[Person_(schema)|Person]]
 +
 +
|}
 +
 +
=== Dependencies ===
 +
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 +
|- style="background:silver"
 +
| '''Reference Type
 +
| '''Object Type
 +
| '''Referencing Object
 +
 +
|- valign="top"
 +
| Select
 +
| View
 +
| [[HumanResources.vEmployee_(view)|HumanResources.vEmployee]]
 +
 +
|- valign="top"
 +
| Select
 +
| View
 +
| [[Person.vStateProvinceCountryRegion_(view)|Person.vStateProvinceCountryRegion]]
 +
 +
|- valign="top"
 +
| Select
 +
| View
 +
| [[Purchasing.vVendor_(view)|Purchasing.vVendor]]
 +
 +
|- valign="top"
 +
| Select
 +
| View
 +
| [[Sales.vIndividualCustomer_(view)|Sales.vIndividualCustomer]]
 +
 +
|- valign="top"
 +
| Select
 +
| View
 +
| [[Sales.vSalesPerson_(view)|Sales.vSalesPerson]]
 +
 +
|- valign="top"
 +
| Select
 +
| View
 +
| [[Sales.vStoreWithDemographics_(view)|Sales.vStoreWithDemographics]]
 +
 +
|}
 +
 +
 
== automatically generated ==
 
== automatically generated ==
  
Line 116: Line 204:
 
| '''Table
 
| '''Table
 
| Person.StateProvince
 
| Person.StateProvince
|-
+
|- valign="top"
 
 
 
| '''Description
 
| '''Description
 
| State and province lookup table.
 
| State and province lookup table.
 
|-
 
|-
 
 
|}
 
|}
  
Line 138: Line 224:
 
| not null
 
| not null
 
|  
 
|  
| Primary key for StateProvince records.PK_StateProvince_StateProvinceID
+
| Primary key for StateProvince records.<br />PK_StateProvince_StateProvinceID
 
|- valign="top"
 
|- valign="top"
 
| StateProvinceCode
 
| StateProvinceCode
Line 144: Line 230:
 
| not null
 
| not null
 
|  
 
|  
| ISO standard state or province code.AK_StateProvince_StateProvinceCode_CountryRegionCode
+
| ISO standard state or province code.<br />AK_StateProvince_StateProvinceCode_CountryRegionCode
 
|- valign="top"
 
|- valign="top"
 
| CountryRegionCode
 
| CountryRegionCode
Line 150: Line 236:
 
| not null
 
| not null
 
|  
 
|  
| ISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode. AK_StateProvince_StateProvinceCode_CountryRegionCode
+
| ISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode. <br />AK_StateProvince_StateProvinceCode_CountryRegionCode
 
|- valign="top"
 
|- valign="top"
 
| IsOnlyStateProvinceFlag
 
| IsOnlyStateProvinceFlag
Line 156: Line 242:
 
| not null
 
| not null
 
| (1)
 
| (1)
| 0 = StateProvinceCode exists. 1 = StateProvinceCode unavailable, using CountryRegionCode.
+
| 0 = StateProvinceCode exists. 1 = StateProvinceCode unavailable, using CountryRegionCode.<br />
 
|- valign="top"
 
|- valign="top"
 
| Name
 
| Name
Line 162: Line 248:
 
| not null
 
| not null
 
|  
 
|  
| State or province description.AK_StateProvince_Name
+
| State or province description.<br />AK_StateProvince_Name
 
|- valign="top"
 
|- valign="top"
 
| TerritoryID
 
| TerritoryID
Line 168: Line 254:
 
| not null
 
| not null
 
|  
 
|  
| ID of the territory in which the state or province is located. Foreign key to SalesTerritory.SalesTerritoryID.
+
| ID of the territory in which the state or province is located. Foreign key to SalesTerritory.SalesTerritoryID.<br />
 
|- valign="top"
 
|- valign="top"
 
| rowguid
 
| rowguid
Line 174: Line 260:
 
| not null
 
| not null
 
| (NEWID())
 
| (NEWID())
| ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.AK_StateProvince_rowguid
+
| ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.<br />AK_StateProvince_rowguid
 
|- valign="top"
 
|- valign="top"
 
| ModifiedDate
 
| ModifiedDate
Line 180: Line 266:
 
| not null
 
| not null
 
| (GETDATE())
 
| (GETDATE())
| Date and time the record was last updated.
+
| Date and time the record was last updated.<br />
 
|}
 
|}
  
Line 221: Line 307:
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 
|- style="background:silver"
 
|- style="background:silver"
 +
| '''Dependency Type
 +
| '''Object Type
 
| '''Referenced Object
 
| '''Referenced Object
| '''Object Type
+
 
| '''Dependency Type
 
 
 
|-
 
|-
 +
| Data Type
 +
| Type
 
| [[dbo.Flag_(type)|dbo.Flag]]
 
| [[dbo.Flag_(type)|dbo.Flag]]
 +
 +
|-
 +
| Data Type
 
| Type
 
| Type
| Data Type
+
| [[dbo.Name_(type)|dbo.Name]]
 +
 
 
|-
 
|-
| [[dbo.Name_(type)|dbo.Name]]
+
| Schema
| Type
+
| Schema
| Data Type
+
| [[Person_(schema)|Person]]
 +
 
 
|}
 
|}
  
Line 238: Line 331:
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 
|- style="background:silver"
 
|- style="background:silver"
 +
| '''Reference Type
 +
| '''Object Type
 
| '''Referencing Object
 
| '''Referencing Object
| '''Object Type
+
 
| '''Reference Type
 
 
 
|-
 
|-
 +
| Select
 +
| View
 
| [[HumanResources.vEmployee_(view)|HumanResources.vEmployee]]
 
| [[HumanResources.vEmployee_(view)|HumanResources.vEmployee]]
 +
 +
|-
 +
| Select
 
| View
 
| View
 +
| [[Person.vStateProvinceCountryRegion_(view)|Person.vStateProvinceCountryRegion]]
 +
 +
|-
 
| Select
 
| Select
 +
| View
 +
| [[Purchasing.vVendor_(view)|Purchasing.vVendor]]
 +
 
|-
 
|-
| [[Person.vStateProvinceCountryRegion_(view)|Person.vStateProvinceCountryRegion]]
+
| Select
 
| View
 
| View
 +
| [[Sales.vIndividualCustomer_(view)|Sales.vIndividualCustomer]]
 +
 +
|-
 
| Select
 
| Select
|-
 
| [[Purchasing.vVendor_(view)|Purchasing.vVendor]]
 
 
| View
 
| View
| Select
+
| [[Sales.vSalesPerson_(view)|Sales.vSalesPerson]]
 +
 
 
|-
 
|-
| [[Sales.vIndividualCustomer_(view)|Sales.vIndividualCustomer]]
 
| View
 
 
| Select
 
| Select
|-
 
| [[Sales.vSalesPerson_(view)|Sales.vSalesPerson]]
 
 
| View
 
| View
| Select
 
|-
 
 
| [[Sales.vStoreWithDemographics_(view)|Sales.vStoreWithDemographics]]
 
| [[Sales.vStoreWithDemographics_(view)|Sales.vStoreWithDemographics]]
| View
+
 
| Select
 
 
|}
 
|}

Latest revision as of 10:55, 27 August 2011

wikibot[edit]

Table Person.StateProvince
Description State and province lookup table.

Columns[edit]

Column Data Type Nullable Default Description
StateProvinceID int not null Primary key for StateProvince records.
StateProvinceCode nchar(3) not null ISO standard state or province code.
CountryRegionCode nvarchar(3) not null ISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode.
IsOnlyStateProvinceFlag dbo.Flag not null ((1)) 0 = StateProvinceCode exists. 1 = StateProvinceCode unavailable, using CountryRegionCode.
Name dbo.Name not null State or province description.
TerritoryID int not null ID of the territory in which the state or province is located. Foreign key to SalesTerritory.SalesTerritoryID.
rowguid uniqueidentifier not null (newid()) ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ModifiedDate datetime not null (getdate()) Date and time the record was last updated.

Primary Key[edit]

Primary Key Columns
PK_StateProvince_StateProvinceID StateProvinceID

Indexes[edit]

Index Type Columns
AK_StateProvince_Name Unique Name
AK_StateProvince_rowguid Unique rowguid
AK_StateProvince_StateProvinceCode_CountryRegionCode Unique StateProvinceCode, CountryRegionCode

Foreign Keys[edit]

Relation Column Referenced Column
Person.CountryRegion CountryRegionCode CountryRegionCode
Sales.SalesTerritory TerritoryID TerritoryID

Detail Tables[edit]

Detail Table Column Referencing Column
Person.Address StateProvinceID StateProvinceID
Sales.SalesTaxRate StateProvinceID StateProvinceID

References[edit]

Dependency Type Object Type Referenced Object
Data Type Type dbo.Flag
Data Type Type dbo.Name
Schema Schema Person

Dependencies[edit]

Reference Type Object Type Referencing Object
Select View HumanResources.vEmployee
Select View Person.vStateProvinceCountryRegion
Select View Purchasing.vVendor
Select View Sales.vIndividualCustomer
Select View Sales.vSalesPerson
Select View Sales.vStoreWithDemographics


automatically generated[edit]

Table Person.StateProvince
Description State and province lookup table.


Column Data Type Nullable Default Description / PK / Index
StateProvinceID int not null Primary key for StateProvince records.
PK_StateProvince_StateProvinceID
StateProvinceCode nchar(3) not null ISO standard state or province code.
AK_StateProvince_StateProvinceCode_CountryRegionCode
CountryRegionCode nvarchar(3) not null ISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode.
AK_StateProvince_StateProvinceCode_CountryRegionCode
IsOnlyStateProvinceFlag Flag not null (1) 0 = StateProvinceCode exists. 1 = StateProvinceCode unavailable, using CountryRegionCode.
Name Name not null State or province description.
AK_StateProvince_Name
TerritoryID int not null ID of the territory in which the state or province is located. Foreign key to SalesTerritory.SalesTerritoryID.
rowguid uniqueidentifier not null (NEWID()) ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
AK_StateProvince_rowguid
ModifiedDate datetime not null (GETDATE()) Date and time the record was last updated.


Relation Column Referenced Column
Person.CountryRegion CountryRegionCode CountryRegionCode
Sales.SalesTerritory TerritoryID TerritoryID


Detail Table Column Referencing Column
Person.Address StateProvinceID StateProvinceID
Sales.SalesTaxRate StateProvinceID StateProvinceID


Dependency Type Object Type Referenced Object
Data Type Type dbo.Flag
Data Type Type dbo.Name
Schema Schema Person


Reference Type Object Type Referencing Object
Select View HumanResources.vEmployee
Select View Person.vStateProvinceCountryRegion
Select View Purchasing.vVendor
Select View Sales.vIndividualCustomer
Select View Sales.vSalesPerson
Select View Sales.vStoreWithDemographics