Purchasing.vVendorWithAddresses
Documentation | AdventureWorks |
Schema | Purchasing |
Name | vVendorWithAddresses |
Module | Purchasing |
Vendor (company) names and addresses .
Columns
Key | Name | Data type | Null | Attributes | References | Description | ||
---|---|---|---|---|---|---|---|---|
1 | BusinessEntityID | int | ||||||
2 | Name | nvarchar(50) | ||||||
3 | AddressType | nvarchar(50) | ||||||
4 | AddressLine1 | nvarchar(60) | ||||||
5 | AddressLine2 | nvarchar(60) | ||||||
6 | City | nvarchar(30) | ||||||
7 | StateProvinceName | nvarchar(50) | ||||||
8 | PostalCode | nvarchar(15) | ||||||
9 | CountryRegionName | nvarchar(50) |
Uses
Name |
---|
Purchasing.vVendorWithAddresses
|
Script
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]; |
Exported: 2019-02-04 23:13, Last imported: 2018-03-07 11:56