AdventureWorks
Person.vStateProvinceCountryRegion View
Description
Joins StateProvince table with CountryRegion table.
Properties
Creation Date08/01/2010 08:41
Is Schema Bound
Encrypted
Ansi Nulls
Columns
 Column NameDescriptionDatatypeLengthAllow NullsDefaultFormula
 StateProvinceID int4   
 StateProvinceCode nchar3   
 IsOnlyStateProvinceFlag dbo.Flag1   
 StateProvinceName dbo.Name50   
 TerritoryID int4   
 CountryRegionCode nvarchar3   
 CountryRegionName dbo.Name50   
Objects that Person.vStateProvinceCountryRegion depends on
 Database ObjectObject TypeDescriptionDep Level
Person.CountryRegion tablePerson.CountryRegionTableLookup table containing the ISO standard codes for countries and regions.1
dbo.Flag datatypedbo.FlagUser Defined Data Type 2
dbo.Name datatypedbo.NameUser Defined Data Type 2
Sales.SalesTerritory tableSales.SalesTerritoryTableSales territory lookup table.2
Person.StateProvince tablePerson.StateProvinceTableState and province lookup table.1
View Definition
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

Related Objects

Person Schema
AdventureWorks Database

 

 


© 2012 All Rights Reserved.

Send comments on this topic.