← All tables and views
AdventureWorks OLTP view
Person.vStateProvinceCountryRegion
Native view in the AdventureWorks OLTP sample database.
181rows
7 columns
Schema from the provider contract| Column | Type | Nullable | Key | References |
|---|---|---|---|---|
StateProvinceID | | yes | — | — |
StateProvinceCode | | yes | — | — |
IsOnlyStateProvinceFlag | | yes | — | — |
StateProvinceName | | yes | — | — |
TerritoryID | | yes | — | — |
CountryRegionCode | | yes | — | — |
CountryRegionName | | yes | — | — |
View definition
CREATE VIEW "Person.vStateProvinceCountryRegion" AS
SELECT
sp."StateProvinceID"
,sp."StateProvinceCode"
,sp."IsOnlyStateProvinceFlag"
,sp."Name" AS "StateProvinceName"
,sp."TerritoryID"
,cr."CountryRegionCode"
,cr."Name" AS "CountryRegionName"
FROM "Person.StateProvince" sp
INNER JOIN "Person.CountryRegion" cr
ON sp."CountryRegionCode" = cr."CountryRegionCode"Data preview
Sample records
| StateProvinceID | StateProvinceCode | IsOnlyStateProvinceFlag | StateProvinceName | TerritoryID | CountryRegionCode | CountryRegionName |
|---|---|---|---|---|---|---|
| 1 | AB | 0 | Alberta | 6 | CA | Canada |
| 2 | AK | 0 | Alaska | 1 | US | United States |
| 3 | AL | 0 | Alabama | 5 | US | United States |
| 4 | AR | 0 | Arkansas | 3 | US | United States |
| 5 | AS | 1 | American Samoa | 1 | AS | American Samoa |
| 6 | AZ | 0 | Arizona | 4 | US | United States |
| 7 | BC | 0 | British Columbia | 6 | CA | Canada |
| 8 | BY | 0 | Bayern | 8 | DE | Germany |