Sales.Customer
Documentation | AdventureWorks |
Schema | Sales |
Name | Customer |
Module | Sales |
Current customer information. Also see the Person and Store tables.
Columns
Key | Name | Data type | Null | Attributes | References | Description | ||
---|---|---|---|---|---|---|---|---|
1 | CustomerID | int | Identity | Primary key. | ||||
Primary key. Identity |
||||||||
2 | PersonID | int | Person.Person | Foreign key to Person.BusinessEntityID | ||||
Foreign key to Person.BusinessEntityID References: Person.Person |
||||||||
3 | StoreID | int | Sales.Store | Foreign key to Store.BusinessEntityID | ||||
Foreign key to Store.BusinessEntityID References: Sales.Store |
||||||||
4 | TerritoryID | int | Sales.SalesTerritory | ID of the territory in which the customer is located. Foreign key to SalesTerritory.SalesTerritoryID. | ||||
ID of the territory in which the customer is located. Foreign key to SalesTerritory.SalesTerritoryID. References: Sales.SalesTerritory |
||||||||
5 | AccountNumber | varchar(10) | Computed: isnull('AW'+[ufnLeadingZeros]([CustomerID]),'') | Unique number identifying the customer assigned by the accounting system. | ||||
Unique number identifying the customer assigned by the accounting system. Computed: isnull('AW'+[ufnLeadingZeros]([CustomerID]),'') |
||||||||
6 | rowguid | uniqueidentifier | Default: newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | ||||
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. Default: newid() |
||||||||
7 | ModifiedDate | datetime | Default: getdate() | Date and time the record was last updated. | ||||
Date and time the record was last updated. Default: getdate() |
Relations
Foreign table | Primary table | Join | Title / Name / Description | |
---|---|---|---|---|
Sales.Customer | Person.Person | Sales.Customer.PersonID = Person.Person.BusinessEntityID | FK_Customer_Person_PersonID Foreign key constraint referencing Person.BusinessEntityID. |
|
Sales.Customer.PersonID = Person.Person.BusinessEntityID Name: FK_Customer_Person_PersonIDForeign key constraint referencing Person.BusinessEntityID. |
||||
Sales.Customer | Sales.SalesTerritory | Sales.Customer.TerritoryID = Sales.SalesTerritory.TerritoryID | FK_Customer_SalesTerritory_TerritoryID Foreign key constraint referencing SalesTerritory.TerritoryID. |
|
Sales.Customer.TerritoryID = Sales.SalesTerritory.TerritoryID Name: FK_Customer_SalesTerritory_TerritoryIDForeign key constraint referencing SalesTerritory.TerritoryID. |
||||
Sales.Customer | Sales.Store | Sales.Customer.StoreID = Sales.Store.BusinessEntityID | FK_Customer_Store_StoreID Foreign key constraint referencing Store.BusinessEntityID. |
|
Sales.Customer.StoreID = Sales.Store.BusinessEntityID Name: FK_Customer_Store_StoreIDForeign key constraint referencing Store.BusinessEntityID. |
||||
Sales.SalesOrderHeader | Sales.Customer | Sales.SalesOrderHeader.CustomerID = Sales.Customer.CustomerID | FK_SalesOrderHeader_Customer_CustomerID Foreign key constraint referencing Customer.CustomerID. |
|
Sales.SalesOrderHeader.CustomerID = Sales.Customer.CustomerID Name: FK_SalesOrderHeader_Customer_CustomerIDForeign key constraint referencing Customer.CustomerID. |
Unique keys
Key name | Columns | Description | |
---|---|---|---|
PK_Customer_CustomerID | CustomerID | Primary key (clustered) constraint | |
Primary key (clustered) constraint | |||
AK_Customer_AccountNumber | AccountNumber | Unique nonclustered index. | |
Unique nonclustered index. | |||
AK_Customer_rowguid | rowguid | Unique nonclustered index. Used to support replication samples. | |
Unique nonclustered index. Used to support replication samples. |
Uses
Name |
---|
Sales.Customer
|
Sales.Customer
|
Used by
Name |
---|
Sales.Customer
|
Sales.Customer
|
Exported: 2019-02-04 23:13, Last imported: 2018-03-07 11:56