Difference between revisions of "Sales.Customer (table)"
Line 128: | Line 128: | ||
| not null | | not null | ||
| | | | ||
− | | Primary key for Customer records.PK_Customer_CustomerID | + | | Primary key for Customer records.<br />PK_Customer_CustomerID |
|- valign="top" | |- valign="top" | ||
| TerritoryID | | TerritoryID | ||
Line 134: | Line 134: | ||
| null | | null | ||
| | | | ||
− | | ID of the territory in which the customer is located. Foreign key to SalesTerritory.SalesTerritoryID.IX_Customer_TerritoryID | + | | ID of the territory in which the customer is located. Foreign key to SalesTerritory.SalesTerritoryID.<br />IX_Customer_TerritoryID |
|- valign="top" | |- valign="top" | ||
| AccountNumber | | AccountNumber | ||
Line 140: | Line 140: | ||
| | | | ||
| | | | ||
− | | Unique number identifying the customer assigned by the accounting system.AK_Customer_AccountNumber | + | | Unique number identifying the customer assigned by the accounting system.<br />AK_Customer_AccountNumber |
|- valign="top" | |- valign="top" | ||
| CustomerType | | CustomerType | ||
Line 146: | Line 146: | ||
| not null | | not null | ||
| | | | ||
− | | Customer type: I = Individual, S = Store | + | | Customer type: I = Individual, S = Store<br /> |
|- valign="top" | |- valign="top" | ||
| rowguid | | rowguid | ||
Line 152: | Line 152: | ||
| not null | | not null | ||
| (NEWID()) | | (NEWID()) | ||
− | | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.AK_Customer_rowguid | + | | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.<br />AK_Customer_rowguid |
|- valign="top" | |- valign="top" | ||
| ModifiedDate | | ModifiedDate | ||
Line 158: | Line 158: | ||
| not null | | not null | ||
| (GETDATE()) | | (GETDATE()) | ||
− | | Date and time the record was last updated. | + | | Date and time the record was last updated.<br /> |
|} | |} | ||
Revision as of 01:10, 27 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 |