Welcome Guest, you are in: Login

devio dbscript ScrewTurn Wiki

RSS RSS

Navigation





Search the wiki
»

PoweredBy

Page History: Person vStateProvinceCountryRegion (view)

Compare Page Revisions



« Older Revision - Back to Page History - Newer Revision »


Page Revision: 2010/01/09 17:54


wikibot

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

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