← All tables and views

AdventureWorks OLTP view

Purchasing.vVendorWithAddresses

Native view in the AdventureWorks OLTP sample database.

104rows

9 columns

Schema from the provider contract
ColumnTypeNullableKeyReferences
BusinessEntityIDyes——
Nameyes——
AddressTypeyes——
AddressLine1yes——
AddressLine2yes——
Cityyes——
StateProvinceNameyes——
PostalCodeyes——
CountryRegionNameyes——

View definition

CREATE VIEW "Purchasing.vVendorWithAddresses" AS
SELECT
    v."BusinessEntityID"
    ,v."Name"
    ,at."Name" AS "AddressType"
    ,a."AddressLine1"
    ,a."AddressLine2"
    ,a."City"
    ,sp."Name" AS "StateProvinceName"
    ,a."PostalCode"
    ,cr."Name" AS "CountryRegionName"
FROM "Purchasing.Vendor" v
    INNER JOIN "Person.BusinessEntityAddress" bea
    ON bea."BusinessEntityID" = v."BusinessEntityID"
    INNER JOIN "Person.Address" a
    ON a."AddressID" = bea."AddressID"
    INNER JOIN "Person.StateProvince" sp
    ON sp."StateProvinceID" = a."StateProvinceID"
    INNER JOIN "Person.CountryRegion" cr
    ON cr."CountryRegionCode" = sp."CountryRegionCode"
    INNER JOIN "Person.AddressType" at
    ON at."AddressTypeID" = bea."AddressTypeID"

Data preview

Sample records

104 rows available
BusinessEntityIDNameAddressTypeAddressLine1AddressLine2CityStateProvinceName
1492Australia Bike RetailerMain Office28 San Marino Ct.NULLBellinghamWashington
1494Allenson CyclesMain Office4659 MontoyaNULLAltadenaCalifornia
1496Advanced BicyclesMain Office7995 Edwards Ave.NULLLynnwoodWashington
1498Trikes, Inc.Main Office90 Sunny AveNULLBerkeleyCalifornia
1500Morgan Bike AccessoriesMain Office9098 Story LaneNULLAlbanyNew York
1502Cycling MasterMain Office4823 Stonewood Ct.NULLWalla WallaWashington
1504Chicago Rent-AllMain Office15 Pear Dr.NULLNewport BeachCalifornia
1506Greenwood Athletic CompanyMain Office6441 Co RoadNULLLemon GroveArizona