ScrewTurn Wiki
Navigation
Main Page
Random Page
Create a new Page
All Pages
Categories
Administration
File Management
Login/Logout
Language Selection
Your Profile
Create Account
Quick Search
Advanced Search »
Back
History
Sales.vIndividualCustomer_(view)
== wikibot == {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" |- valign="top" | '''View''' | Sales.vIndividualCustomer |- valign="top" | '''Description''' | Individual customers (names and addresses) that purchase Adventure Works Cycles products online. |} === Source === {{{{<nowiki> CREATE VIEW [Sales].[vIndividualCustomer] AS SELECT i.[CustomerID] ,c.[Title] ,c.[FirstName] ,c.[MiddleName] ,c.[LastName] ,c.[Suffix] ,c.[Phone] ,c.[EmailAddress] ,c.[EmailPromotion] ,at.[Name] AS [AddressType] ,a.[AddressLine1] ,a.[AddressLine2] ,a.[City] ,[StateProvinceName] = sp.[Name] ,a.[PostalCode] ,[CountryRegionName] = cr.[Name] ,i.[Demographics] FROM [Sales].[Individual] i INNER JOIN [Person].[Contact] c ON c.[ContactID] = i.[ContactID] INNER JOIN [Sales].[CustomerAddress] ca ON ca.[CustomerID] = i.[CustomerID] INNER JOIN [Person].[Address] a ON a.[AddressID] = ca.[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 ca.[AddressTypeID] = at.[AddressTypeID] WHERE i.[CustomerID] IN (SELECT [Sales].[Customer].[CustomerID] FROM [Sales].[Customer] WHERE UPPER([Sales].[Customer].[CustomerType]) = 'I'); </nowiki>}}}} === 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.AddressType_(table)|Person.AddressType]] |- valign="top" | Select | Table | [[Person.Contact_(table)|Person.Contact]] |- valign="top" | Select | Table | [[Person.CountryRegion_(table)|Person.CountryRegion]] |- valign="top" | Select | Table | [[Person.StateProvince_(table)|Person.StateProvince]] |- valign="top" | Select | Table | [[Sales.Customer_(table)|Sales.Customer]] |- valign="top" | Select | Table | [[Sales.CustomerAddress_(table)|Sales.CustomerAddress]] |- valign="top" | Select | Table | [[Sales.Individual_(table)|Sales.Individual]] |- valign="top" | Schema | Schema | [[Sales_(schema)|Sales]] |} == automatically generated == {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" |- | '''view''' | Sales.vIndividualCustomer |- valign="top" | '''Description''' | Individual customers (names and addresses) that purchase Adventure Works Cycles products online. |- |} {{{{<nowiki> CREATE VIEW [Sales].[vIndividualCustomer] AS SELECT i.[CustomerID] ,c.[Title] ,c.[FirstName] ,c.[MiddleName] ,c.[LastName] ,c.[Suffix] ,c.[Phone] ,c.[EmailAddress] ,c.[EmailPromotion] ,at.[Name] AS [AddressType] ,a.[AddressLine1] ,a.[AddressLine2] ,a.[City] ,[StateProvinceName] = sp.[Name] ,a.[PostalCode] ,[CountryRegionName] = cr.[Name] ,i.[Demographics] FROM [Sales].[Individual] i INNER JOIN [Person].[Contact] c ON c.[ContactID] = i.[ContactID] INNER JOIN [Sales].[CustomerAddress] ca ON ca.[CustomerID] = i.[CustomerID] INNER JOIN [Person].[Address] a ON a.[AddressID] = ca.[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 ca.[AddressTypeID] = at.[AddressTypeID] WHERE i.[CustomerID] IN (SELECT [Sales].[Customer].[CustomerID] FROM [Sales].[Customer] WHERE UPPER([Sales].[Customer].[CustomerType]) = 'I'); </nowiki>}}}} {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" |- style="background:silver" | '''Dependency Type''' | '''Object Type''' | '''Referenced Object''' |- | Select | Table | [[Person.Address_(table)|Person.Address]] |- | Select | Table | [[Person.AddressType_(table)|Person.AddressType]] |- | Select | Table | [[Person.Contact_(table)|Person.Contact]] |- | Select | Table | [[Person.CountryRegion_(table)|Person.CountryRegion]] |- | Select | Table | [[Person.StateProvince_(table)|Person.StateProvince]] |- | Select | Table | [[Sales.Customer_(table)|Sales.Customer]] |- | Select | Table | [[Sales.CustomerAddress_(table)|Sales.CustomerAddress]] |- | Select | Table | [[Sales.Individual_(table)|Sales.Individual]] |- | Schema | Schema | [[Sales_(schema)|Sales]] |}
ScrewTurn Wiki version 2.0.36. Some of the icons created by
FamFamFam
.