ScrewTurn Wiki

Edit

wikibot

ViewPerson.vStateProvinceCountryRegion
DescriptionJoins StateProvince table with CountryRegion table.

Edit

Source

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

Edit

References

Dependency TypeObject TypeReferenced Object
SelectTablePerson.CountryRegion
SelectTablePerson.StateProvince
SchemaSchemaPerson

Edit

automatically generated

view Person.vStateProvinceCountryRegion
DescriptionJoins 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 TypeObject TypeReferenced Object
SelectTablePerson.CountryRegion
SelectTablePerson.StateProvince
SchemaSchemaPerson

ScrewTurn Wiki version 2.0.36. Some of the icons created by FamFamFam.