Difference between revisions of "Purchasing.vVendor (view)"

From dbscript Online Help
Jump to: navigation, search
 
(4 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
|-
+
|- valign="top"
| '''view
+
| '''View
 
| Purchasing.vVendor
 
| Purchasing.vVendor
|-
+
|- valign="top"
 +
| '''Description
 +
| Vendor (company) names and addresses and the names of vendor employees to contact.
 
|}
 
|}
  
 +
=== Source ===
 
<pre>
 
<pre>
 
CREATE VIEW [Purchasing].[vVendor] AS  
 
CREATE VIEW [Purchasing].[vVendor] AS  
Line 44: Line 47:
 
     ON cr.[CountryRegionCode] = sp.[CountryRegionCode];
 
     ON cr.[CountryRegionCode] = sp.[CountryRegionCode];
 
</pre>
 
</pre>
 +
 +
=== References ===
 +
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 +
|- style="background:silver"
 +
| '''Dependency Type
 +
| '''Object Type
 +
| '''Referenced Object
 +
 +
|- valign="top"
 +
| Select
 +
| Table
 +
| [[Person.Address_(table)|Person.Address]]
 +
 +
|- valign="top"
 +
| Select
 +
| Table
 +
| [[Person.Contact_(table)|Person.Contact]]
 +
 +
|- valign="top"
 +
| Select
 +
| Table
 +
| [[Person.ContactType_(table)|Person.ContactType]]
 +
 +
|- valign="top"
 +
| Select
 +
| Table
 +
| [[Person.CountryRegion_(table)|Person.CountryRegion]]
 +
 +
|- valign="top"
 +
| Select
 +
| Table
 +
| [[Person.StateProvince_(table)|Person.StateProvince]]
 +
 +
|- valign="top"
 +
| Select
 +
| Table
 +
| [[Purchasing.Vendor_(table)|Purchasing.Vendor]]
 +
 +
|- valign="top"
 +
| Select
 +
| Table
 +
| [[Purchasing.VendorAddress_(table)|Purchasing.VendorAddress]]
 +
 +
|- valign="top"
 +
| Select
 +
| Table
 +
| [[Purchasing.VendorContact_(table)|Purchasing.VendorContact]]
 +
 +
|- valign="top"
 +
| Schema
 +
| Schema
 +
| [[Purchasing_(schema)|Purchasing]]
 +
 +
|}
 +
 +
 
== automatically generated ==
 
== automatically generated ==
  
Line 51: Line 110:
 
| Purchasing.vVendor
 
| Purchasing.vVendor
 
|- valign="top"
 
|- valign="top"
 
 
| '''Description
 
| '''Description
 
| Vendor (company) names and addresses and the names of vendor employees to contact.
 
| Vendor (company) names and addresses and the names of vendor employees to contact.
 
|-
 
|-
 
 
|}
 
|}
  
Line 99: Line 156:
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 
|- style="background:silver"
 
|- style="background:silver"
 +
| '''Dependency Type
 +
| '''Object Type
 
| '''Referenced Object
 
| '''Referenced Object
| '''Object Type
 
| '''Dependency Type
 
  
 
|-
 
|-
 +
| Select
 +
| Table
 
| [[Person.Address_(table)|Person.Address]]
 
| [[Person.Address_(table)|Person.Address]]
 +
 +
|-
 +
| Select
 
| Table
 
| Table
 +
| [[Person.Contact_(table)|Person.Contact]]
 +
 +
|-
 
| Select
 
| Select
 +
| Table
 +
| [[Person.ContactType_(table)|Person.ContactType]]
 +
 
|-
 
|-
| [[Person.Contact_(table)|Person.Contact]]
+
| Select
 
| Table
 
| Table
 +
| [[Person.CountryRegion_(table)|Person.CountryRegion]]
 +
 +
|-
 
| Select
 
| Select
 +
| Table
 +
| [[Person.StateProvince_(table)|Person.StateProvince]]
 +
 
|-
 
|-
| [[Person.ContactType_(table)|Person.ContactType]]
+
| Select
 
| Table
 
| Table
| Select
+
| [[Purchasing.Vendor_(table)|Purchasing.Vendor]]
 +
 
 
|-
 
|-
| [[Person.CountryRegion_(table)|Person.CountryRegion]]
 
| Table
 
 
| Select
 
| Select
|-
 
| [[Person.StateProvince_(table)|Person.StateProvince]]
 
 
| Table
 
| Table
| Select
+
| [[Purchasing.VendorAddress_(table)|Purchasing.VendorAddress]]
 +
 
 
|-
 
|-
| [[Purchasing.Vendor_(table)|Purchasing.Vendor]]
 
| Table
 
 
| Select
 
| Select
|-
 
| [[Purchasing.VendorAddress_(table)|Purchasing.VendorAddress]]
 
 
| Table
 
| Table
| Select
 
|-
 
 
| [[Purchasing.VendorContact_(table)|Purchasing.VendorContact]]
 
| [[Purchasing.VendorContact_(table)|Purchasing.VendorContact]]
| Table
+
 
| Select
 
 
|-
 
|-
| [[.Purchasing_(schema)|.Purchasing]]
 
 
| Schema
 
| Schema
 
| Schema
 
| Schema
 +
| [[Purchasing_(schema)|Purchasing]]
 +
 
|}
 
|}

Latest revision as of 00:17, 24 June 2010

wikibot[edit]

View Purchasing.vVendor
Description Vendor (company) names and addresses and the names of vendor employees to contact.

Source[edit]

CREATE VIEW [Purchasing].[vVendor] AS 
SELECT 
    v.[VendorID]
    ,v.[Name]
    ,ct.[Name] AS [ContactType]
    ,c.[Title]
    ,c.[FirstName]
    ,c.[MiddleName]
    ,c.[LastName]
    ,c.[Suffix]
    ,c.[Phone]
    ,c.[EmailAddress]
    ,c.[EmailPromotion]
    ,a.[AddressLine1]
    ,a.[AddressLine2]
    ,a.[City]
    ,[StateProvinceName] = sp.[Name]
    ,a.[PostalCode]
    ,[CountryRegionName] = cr.[Name]
FROM [Purchasing].[Vendor] v
    INNER JOIN [Purchasing].[VendorContact] vc 
    ON vc.[VendorID] = v.[VendorID]
    INNER JOIN [Person].[Contact] c 
    ON c.[ContactID] = vc.[ContactID]
    INNER JOIN [Person].[ContactType] ct 
    ON vc.[ContactTypeID] = ct.[ContactTypeID]
    INNER JOIN [Purchasing].[VendorAddress] va 
    ON va.[VendorID] = v.[VendorID]
    INNER JOIN [Person].[Address] a 
    ON a.[AddressID] = va.[AddressID]
    INNER JOIN [Person].[StateProvince] sp 
    ON sp.[StateProvinceID] = a.[StateProvinceID]
    INNER JOIN [Person].[CountryRegion] cr 
    ON cr.[CountryRegionCode] = sp.[CountryRegionCode];

References[edit]

Dependency Type Object Type Referenced Object
Select Table Person.Address
Select Table Person.Contact
Select Table Person.ContactType
Select Table Person.CountryRegion
Select Table Person.StateProvince
Select Table Purchasing.Vendor
Select Table Purchasing.VendorAddress
Select Table Purchasing.VendorContact
Schema Schema Purchasing


automatically generated[edit]

view Purchasing.vVendor
Description Vendor (company) names and addresses and the names of vendor employees to contact.

CREATE VIEW [Purchasing].[vVendor] AS 
SELECT 
    v.[VendorID]
    ,v.[Name]
    ,ct.[Name] AS [ContactType]
    ,c.[Title]
    ,c.[FirstName]
    ,c.[MiddleName]
    ,c.[LastName]
    ,c.[Suffix]
    ,c.[Phone]
    ,c.[EmailAddress]
    ,c.[EmailPromotion]
    ,a.[AddressLine1]
    ,a.[AddressLine2]
    ,a.[City]
    ,[StateProvinceName] = sp.[Name]
    ,a.[PostalCode]
    ,[CountryRegionName] = cr.[Name]
FROM [Purchasing].[Vendor] v
    INNER JOIN [Purchasing].[VendorContact] vc 
    ON vc.[VendorID] = v.[VendorID]
    INNER JOIN [Person].[Contact] c 
    ON c.[ContactID] = vc.[ContactID]
    INNER JOIN [Person].[ContactType] ct 
    ON vc.[ContactTypeID] = ct.[ContactTypeID]
    INNER JOIN [Purchasing].[VendorAddress] va 
    ON va.[VendorID] = v.[VendorID]
    INNER JOIN [Person].[Address] a 
    ON a.[AddressID] = va.[AddressID]
    INNER JOIN [Person].[StateProvince] sp 
    ON sp.[StateProvinceID] = a.[StateProvinceID]
    INNER JOIN [Person].[CountryRegion] cr 
    ON cr.[CountryRegionCode] = sp.[CountryRegionCode];


Dependency Type Object Type Referenced Object
Select Table Person.Address
Select Table Person.Contact
Select Table Person.ContactType
Select Table Person.CountryRegion
Select Table Person.StateProvince
Select Table Purchasing.Vendor
Select Table Purchasing.VendorAddress
Select Table Purchasing.VendorContact
Schema Schema Purchasing