Person.vStateProvinceCountryRegion (view)

From dbscript Online Help
Jump to: navigation, search

wikibot[edit]

View Person.vStateProvinceCountryRegion
Description Joins StateProvince table with CountryRegion table.

Source[edit]

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];

References[edit]

Dependency Type Object Type Referenced Object
Select Table Person.CountryRegion
Select Table Person.StateProvince
Schema Schema Person


automatically generated[edit]

view Person.vStateProvinceCountryRegion
Description Joins StateProvince table with CountryRegion table.

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];


Dependency Type Object Type Referenced Object
Select Table Person.CountryRegion
Select Table Person.StateProvince
Schema Schema Person