Properties

Owner: Person 
Schema bound:  
Encrypted:  
Creation Date: 04/26/2006 
Modification Date: 04/26/2006 
Description: Joins StateProvince table with CountryRegion table. 

Columns

Name Data Type Length NULL IsGUID Description
  StateProvinceID  int       
  StateProvinceCode  nchar       
  IsOnlyStateProvinceFlag  Flag       
  StateProvinceName  Name  100       
  TerritoryID  int       
  CountryRegionCode  nvarchar       
  CountryRegionName  Name  100       
Total: 7 column(s)

Indexes

Index Primary Unique Description
  IX_vStateProvinceCountryRegion      Clustered index on the view vStateProvinceCountryRegion. 
Total: 1 index(es)

Objects that [Person].[vStateProvinceCountryRegion] depends on

Object Name Owner Object Type Dep Level
  Flag  dbo  User Defined type 
  Name  dbo  User Defined type 
  CountryRegion  Person  Table 
  SalesTerritory  Sales  Table 
  StateProvince  Person  Table 
Total: 5 objects

SQL


CREATE VIEW [Person].[vStateProvinceCountryRegion]
WITH SCHEMABINDING
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];

See Also

List of views