Difference between revisions of "Sales.Customer (table)"
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" |
| '''Table | | '''Table | ||
| Sales.Customer | | Sales.Customer | ||
Line 8: | Line 8: | ||
| '''Description | | '''Description | ||
| Current customer information. Also see the Individual and Store tables. | | Current customer information. Also see the Individual and Store tables. | ||
− | |||
|} | |} | ||
− | |||
=== Columns === | === Columns === | ||
Line 20: | Line 18: | ||
| '''Default | | '''Default | ||
| '''Description | | '''Description | ||
− | + | ||
|- valign="top" | |- valign="top" | ||
| CustomerID | | CustomerID | ||
Line 64: | Line 62: | ||
| '''Primary Key | | '''Primary Key | ||
| '''Columns | | '''Columns | ||
− | |- | + | |- valign="top" |
| PK_Customer_CustomerID | | PK_Customer_CustomerID | ||
| CustomerID | | CustomerID | ||
Line 75: | Line 73: | ||
| '''Type | | '''Type | ||
| '''Columns | | '''Columns | ||
− | + | ||
− | |- | + | |- valign="top" |
| AK_Customer_rowguid | | AK_Customer_rowguid | ||
| Unique | | Unique | ||
| rowguid | | rowguid | ||
− | |- | + | |- valign="top" |
| AK_Customer_AccountNumber | | AK_Customer_AccountNumber | ||
| Unique | | Unique | ||
| AccountNumber | | AccountNumber | ||
− | |- | + | |- valign="top" |
| IX_Customer_TerritoryID | | IX_Customer_TerritoryID | ||
| | | | ||
Line 96: | Line 94: | ||
| '''Expression | | '''Expression | ||
| '''Description | | '''Description | ||
− | + | ||
− | |- | + | |- valign="top" |
| CK_Customer_CustomerType | | CK_Customer_CustomerType | ||
| (upper([CustomerType])='I' OR upper([CustomerType])='S') | | (upper([CustomerType])='I' OR upper([CustomerType])='S') | ||
Line 109: | Line 107: | ||
| '''Column | | '''Column | ||
| '''Referenced Column | | '''Referenced Column | ||
− | + | ||
− | |- | + | |- valign="top" |
| [[Sales.SalesTerritory_(table)|Sales.SalesTerritory]] | | [[Sales.SalesTerritory_(table)|Sales.SalesTerritory]] | ||
| TerritoryID | | TerritoryID | ||
Line 122: | Line 120: | ||
| '''Column | | '''Column | ||
| '''Referencing Column | | '''Referencing Column | ||
− | + | ||
− | |- | + | |- valign="top" |
| [[Sales.CustomerAddress_(table)|Sales.CustomerAddress]] | | [[Sales.CustomerAddress_(table)|Sales.CustomerAddress]] | ||
| CustomerID | | CustomerID | ||
| CustomerID | | CustomerID | ||
− | |- | + | |- valign="top" |
| [[Sales.Individual_(table)|Sales.Individual]] | | [[Sales.Individual_(table)|Sales.Individual]] | ||
| CustomerID | | CustomerID | ||
| CustomerID | | CustomerID | ||
− | |- | + | |- valign="top" |
| [[Sales.SalesOrderHeader_(table)|Sales.SalesOrderHeader]] | | [[Sales.SalesOrderHeader_(table)|Sales.SalesOrderHeader]] | ||
| CustomerID | | CustomerID | ||
| CustomerID | | CustomerID | ||
− | |- | + | |- valign="top" |
| [[Sales.Store_(table)|Sales.Store]] | | [[Sales.Store_(table)|Sales.Store]] | ||
| CustomerID | | CustomerID | ||
Line 148: | Line 146: | ||
| '''Referenced Object | | '''Referenced Object | ||
− | |- | + | |- valign="top" |
| Schema | | Schema | ||
| Schema | | Schema | ||
Line 162: | Line 160: | ||
| '''Referencing Object | | '''Referencing Object | ||
− | |- | + | |- valign="top" |
| Select | | Select | ||
| View | | View | ||
| [[Sales.vIndividualCustomer_(view)|Sales.vIndividualCustomer]] | | [[Sales.vIndividualCustomer_(view)|Sales.vIndividualCustomer]] | ||
− | |- | + | |- valign="top" |
| Select | | Select | ||
| View | | View |
Revision as of 00:17, 24 June 2010
Contents
wikibot
Table | Sales.Customer |
Description | Current customer information. Also see the Individual and Store tables. |
Columns
Column | Data Type | Nullable | Default | Description |
CustomerID | int | not null | Primary key for Customer records. | |
TerritoryID | int | null | 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. | |||
CustomerType | nchar(1) | not null | Customer type: I = Individual, S = Store | |
rowguid | uniqueidentifier | not null | (newid()) | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
ModifiedDate | datetime | not null | (getdate()) | Date and time the record was last updated. |
Primary Key
Primary Key | Columns |
PK_Customer_CustomerID | CustomerID |
Indexes
Index | Type | Columns |
AK_Customer_rowguid | Unique | rowguid |
AK_Customer_AccountNumber | Unique | AccountNumber |
IX_Customer_TerritoryID | TerritoryID |
Check Constraints
Check Constraint | Expression | Description |
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
Relation | Column | Referenced Column |
Sales.SalesTerritory | TerritoryID | TerritoryID |
Detail Tables
Detail Table | Column | Referencing Column |
Sales.CustomerAddress | CustomerID | CustomerID |
Sales.Individual | CustomerID | CustomerID |
Sales.SalesOrderHeader | CustomerID | CustomerID |
Sales.Store | CustomerID | CustomerID |
References
Dependency Type | Object Type | Referenced Object |
Schema | Schema | Sales |
Dependencies
Reference Type | Object Type | Referencing Object |
Select | View | Sales.vIndividualCustomer |
Select | View | Sales.vStoreWithDemographics |
automatically generated
Table | Sales.Customer |
Description | Current customer information. Also see the Individual and Store tables. |
Column | Data Type | Nullable | Default | Description / PK / Index |
CustomerID | int | not null | Primary key for Customer records. PK_Customer_CustomerID | |
TerritoryID | int | null | ID of the territory in which the customer is located. Foreign key to SalesTerritory.SalesTerritoryID. IX_Customer_TerritoryID | |
AccountNumber | Unique number identifying the customer assigned by the accounting system. AK_Customer_AccountNumber | |||
CustomerType | nchar(1) | not null | Customer type: I = Individual, S = Store | |
rowguid | uniqueidentifier | not null | (NEWID()) | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. AK_Customer_rowguid |
ModifiedDate | datetime | not null | (GETDATE()) | Date and time the record was last updated. |
Relation | Column | Referenced Column |
Sales.SalesTerritory | TerritoryID | TerritoryID |
Detail Table | Column | Referencing Column |
Sales.CustomerAddress | CustomerID | CustomerID |
Sales.Individual | CustomerID | CustomerID |
Sales.SalesOrderHeader | CustomerID | CustomerID |
Sales.Store | CustomerID | CustomerID |
Dependency Type | Object Type | Referenced Object |
Schema | Schema | Sales |
Reference Type | Object Type | Referencing Object |
Select | View | Sales.vIndividualCustomer |
Select | View | Sales.vStoreWithDemographics |