Views [Purchasing].[vVendorWithContacts]
Vendor (company) names  and the names of vendor employees to contact.
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
ANSI Nulls OnTrue
Quoted Identifier OnTrue
Created13:14:55 14 marca 2012
Last Modified13:14:55 14 marca 2012
NameData TypeMax Length (Bytes)
BusinessEntityIDint4
Name[dbo].[Name]100
ContactType[dbo].[Name]100
Titlenvarchar(8)16
FirstName[dbo].[Name]100
MiddleName[dbo].[Name]100
LastName[dbo].[Name]100
Suffixnvarchar(10)20
PhoneNumber[dbo].[Phone]50
PhoneNumberType[dbo].[Name]100
EmailAddressnvarchar(50)100
EmailPromotionint4

CREATE VIEW [Purchasing].[vVendorWithContacts] AS
SELECT
   v.[BusinessEntityID]
   ,v.[Name]
   ,ct.[Name] AS [ContactType]
   ,p.[Title]
   ,p.[FirstName]
   ,p.[MiddleName]
   ,p.[LastName]
   ,p.[Suffix]
   ,pp.[PhoneNumber]
   ,pnt.[Name] AS [PhoneNumberType]
   ,ea.[EmailAddress]
   ,p.[EmailPromotion]
FROM [Purchasing].[Vendor] v
   INNER JOIN [Person].[BusinessEntityContact] bec
   ON bec.[BusinessEntityID] = v.[BusinessEntityID]
   INNER JOIN [Person].ContactType ct
   ON ct.[ContactTypeID] = bec.[ContactTypeID]
   INNER JOIN [Person].[Person] p
   ON p.[BusinessEntityID] = bec.[PersonID]
   LEFT OUTER JOIN [Person].[EmailAddress] ea
   ON ea.[BusinessEntityID] = p.[BusinessEntityID]
   LEFT OUTER JOIN [Person].[PersonPhone] pp
   ON pp.[BusinessEntityID] = p.[BusinessEntityID]
   LEFT OUTER JOIN [Person].[PhoneNumberType] pnt
   ON pnt.[PhoneNumberTypeID] = pp.[PhoneNumberTypeID];
GO
EXEC sp_addextendedproperty N'MS_Description', N'Vendor (company) names  and the names of vendor employees to contact.', 'SCHEMA', N'Purchasing', 'VIEW', N'vVendorWithContacts', NULL, NULL
GO