Difference between revisions of "Sales.Customer (table)"
Line 100: | Line 100: | ||
| CustomerID | | CustomerID | ||
|} | |} | ||
− | |||
== automatically generated == | == automatically generated == | ||
Line 122: | Line 121: | ||
| '''Nullable | | '''Nullable | ||
| '''Default | | '''Default | ||
− | | '''Description | + | | '''Description / PK / Index |
− | |||
|- | |- | ||
Line 130: | Line 128: | ||
| not null | | not null | ||
| | | | ||
− | | Primary key for Customer records. | + | | Primary key for Customer records.PK_Customer_CustomerID |
− | |||
|- | |- | ||
| TerritoryID | | TerritoryID | ||
Line 137: | Line 134: | ||
| null | | null | ||
| | | | ||
− | | 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.IX_Customer_TerritoryID |
− | |||
|- | |- | ||
| AccountNumber | | AccountNumber | ||
Line 144: | Line 140: | ||
| | | | ||
| | | | ||
− | | Unique number identifying the customer assigned by the accounting system. | + | | Unique number identifying the customer assigned by the accounting system.AK_Customer_AccountNumber |
− | |||
|- | |- | ||
| CustomerType | | CustomerType | ||
Line 152: | Line 147: | ||
| | | | ||
| Customer type: I = Individual, S = Store | | Customer type: I = Individual, S = Store | ||
− | |||
|- | |- | ||
| rowguid | | rowguid | ||
Line 158: | Line 152: | ||
| not null | | not null | ||
| (NEWID()) | | (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.AK_Customer_rowguid |
− | |||
|- | |- | ||
| ModifiedDate | | ModifiedDate | ||
Line 166: | Line 159: | ||
| (GETDATE()) | | (GETDATE()) | ||
| Date and time the record was last updated. | | Date and time the record was last updated. | ||
− | |||
|} | |} | ||
Line 206: | Line 198: | ||
| CustomerID | | CustomerID | ||
| CustomerID | | CustomerID | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
+ | |- style="background:silver" | ||
+ | | '''Referencing Object | ||
+ | | '''Object Type | ||
+ | | '''Reference Type | ||
+ | |||
+ | |- | ||
+ | | [[Sales.vIndividualCustomer_(view)|Sales.vIndividualCustomer]] | ||
+ | | View | ||
+ | | Select | ||
+ | |- | ||
+ | | [[Sales.vStoreWithDemographics_(view)|Sales.vStoreWithDemographics]] | ||
+ | | View | ||
+ | | Select | ||
|} | |} |
Revision as of 23:52, 26 November 2009
wikibot
Table | Sales.Customer |
Column | Data Type | Nullable | Default | PK | Index |
CustomerID | int | not null | PK_Customer_CustomerID | ||
TerritoryID | int | null | IX_Customer_TerritoryID | ||
AccountNumber | AK_Customer_AccountNumber | ||||
CustomerType | nchar(1) | not null | |||
rowguid | uniqueidentifier | not null | (newid()) | AK_Customer_rowguid | |
ModifiedDate | datetime | not null | (getdate()) |
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 |
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 |
Referencing Object | Object Type | Reference Type |
Sales.vIndividualCustomer | View | Select |
Sales.vStoreWithDemographics | View | Select |