Sales Customer (table)

wikibot

TableSales.Customer
DescriptionCurrent customer information. Also see the Individual and Store tables.

Columns

ColumnData TypeNullableDefaultDescription
CustomerIDintnot null Primary key for Customer records.
TerritoryIDintnull ID of the territory in which the customer is located. Foreign key to SalesTerritory.SalesTerritoryID.
AccountNumber   Unique number identifying the customer assigned by the accounting system.
CustomerTypenchar(1)not null Customer type: I = Individual, S = Store
rowguiduniqueidentifiernot null(newid())ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ModifiedDatedatetimenot null(getdate())Date and time the record was last updated.

Primary Key

Primary KeyColumns
PK_Customer_CustomerIDCustomerID

Indexes

IndexTypeColumns
AK_Customer_AccountNumberUniqueAccountNumber
AK_Customer_rowguidUniquerowguid
IX_Customer_TerritoryID TerritoryID

Check Constraints

Check ConstraintExpressionDescription
CK_Customer_CustomerType(upper(CustomerType)='I' OR upper(CustomerType)='S')Check constraint CustomerType='I' OR CustomerType='i' OR CustomerType='S' OR CustomerType='s'

Foreign Keys

RelationColumnReferenced Column
Sales.SalesTerritoryTerritoryIDTerritoryID

Detail Tables

Detail TableColumnReferencing Column
Sales.CustomerAddressCustomerIDCustomerID
Sales.IndividualCustomerIDCustomerID
Sales.SalesOrderHeaderCustomerIDCustomerID
Sales.StoreCustomerIDCustomerID

References

Dependency TypeObject TypeReferenced Object
SchemaSchemaSales

Dependencies

Reference TypeObject TypeReferencing Object
SelectViewSales.vIndividualCustomer
SelectViewSales.vStoreWithDemographics