Difference between revisions of "Sales.Customer (table)"
(10 intermediate revisions by the same user not shown) | |||
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 | ||
− | |- | + | |- valign="top" |
+ | | '''Description | ||
+ | | Current customer information. Also see the Individual and Store tables. | ||
|} | |} | ||
− | + | === Columns === | |
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
|- style="background:silver" | |- style="background:silver" | ||
Line 15: | Line 17: | ||
| '''Nullable | | '''Nullable | ||
| '''Default | | '''Default | ||
− | | ''' | + | | '''Description |
− | + | ||
− | + | |- valign="top" | |
− | |- | ||
| CustomerID | | CustomerID | ||
| int | | int | ||
| not null | | not null | ||
| | | | ||
− | | | + | | Primary key for Customer records. |
− | + | |- valign="top" | |
− | |- | ||
| TerritoryID | | TerritoryID | ||
| int | | int | ||
| null | | null | ||
| | | | ||
− | | | + | | ID of the territory in which the customer is located. Foreign key to SalesTerritory.SalesTerritoryID. |
− | + | |- valign="top" | |
− | |- | ||
| AccountNumber | | AccountNumber | ||
| | | | ||
| | | | ||
| | | | ||
− | | | + | | Unique number identifying the customer assigned by the accounting system. |
− | + | |- valign="top" | |
− | |- | ||
| CustomerType | | CustomerType | ||
| nchar(1) | | nchar(1) | ||
| not null | | not null | ||
| | | | ||
− | | | + | | Customer type: I = Individual, S = Store |
− | + | |- valign="top" | |
− | |- | ||
| rowguid | | rowguid | ||
| uniqueidentifier | | uniqueidentifier | ||
| not null | | not null | ||
| (newid()) | | (newid()) | ||
− | | | + | | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
− | + | |- valign="top" | |
− | |- | ||
| ModifiedDate | | ModifiedDate | ||
| datetime | | datetime | ||
| not null | | not null | ||
| (getdate()) | | (getdate()) | ||
+ | | Date and time the record was last updated. | ||
+ | |} | ||
+ | |||
+ | === Primary Key === | ||
+ | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
+ | |- style="background:silver" | ||
+ | | '''Primary Key | ||
+ | | '''Columns | ||
+ | |- valign="top" | ||
+ | | PK_Customer_CustomerID | ||
+ | | CustomerID | ||
+ | |} | ||
+ | |||
+ | === Indexes === | ||
+ | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
+ | |- style="background:silver" | ||
+ | | '''Index | ||
+ | | '''Type | ||
+ | | '''Columns | ||
+ | |||
+ | |- valign="top" | ||
+ | | AK_Customer_AccountNumber | ||
+ | | Unique | ||
+ | | AccountNumber | ||
+ | |- valign="top" | ||
+ | | AK_Customer_rowguid | ||
+ | | Unique | ||
+ | | rowguid | ||
+ | |- valign="top" | ||
+ | | IX_Customer_TerritoryID | ||
| | | | ||
− | | | + | | TerritoryID |
|} | |} | ||
+ | === Check Constraints === | ||
+ | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
+ | |- style="background:silver" | ||
+ | | '''Check Constraint | ||
+ | | '''Expression | ||
+ | | '''Description | ||
+ | |- valign="top" | ||
+ | | 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 === | ||
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
|- style="background:silver" | |- style="background:silver" | ||
Line 69: | Line 107: | ||
| '''Column | | '''Column | ||
| '''Referenced Column | | '''Referenced Column | ||
− | + | ||
− | |- | + | |- valign="top" |
| [[Sales.SalesTerritory_(table)|Sales.SalesTerritory]] | | [[Sales.SalesTerritory_(table)|Sales.SalesTerritory]] | ||
| TerritoryID | | TerritoryID | ||
Line 76: | Line 114: | ||
|} | |} | ||
− | + | === Detail Tables === | |
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
|- style="background:silver" | |- style="background:silver" | ||
Line 82: | 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 | ||
| CustomerID | | CustomerID | ||
|} | |} | ||
+ | |||
+ | === References === | ||
+ | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
+ | |- style="background:silver" | ||
+ | | '''Dependency Type | ||
+ | | '''Object Type | ||
+ | | '''Referenced Object | ||
+ | |||
+ | |- valign="top" | ||
+ | | Schema | ||
+ | | Schema | ||
+ | | [[Sales_(schema)|Sales]] | ||
+ | |||
+ | |} | ||
+ | |||
+ | === Dependencies === | ||
+ | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
+ | |- style="background:silver" | ||
+ | | '''Reference Type | ||
+ | | '''Object Type | ||
+ | | '''Referencing Object | ||
+ | |||
+ | |- valign="top" | ||
+ | | Select | ||
+ | | View | ||
+ | | [[Sales.vIndividualCustomer_(view)|Sales.vIndividualCustomer]] | ||
+ | |||
+ | |- valign="top" | ||
+ | | Select | ||
+ | | View | ||
+ | | [[Sales.vStoreWithDemographics_(view)|Sales.vStoreWithDemographics]] | ||
+ | |||
+ | |} | ||
+ | |||
+ | |||
== automatically generated == | == automatically generated == | ||
Line 106: | Line 179: | ||
| '''Table | | '''Table | ||
| Sales.Customer | | Sales.Customer | ||
− | |- | + | |- valign="top" |
− | |||
| '''Description | | '''Description | ||
| Current customer information. Also see the Individual and Store tables. | | Current customer information. Also see the Individual and Store tables. | ||
|- | |- | ||
− | |||
|} | |} | ||
Line 128: | Line 199: | ||
| 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 205: | ||
| 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 211: | ||
| | | | ||
| | | | ||
− | | 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 217: | ||
| 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 223: | ||
| 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 229: | ||
| not null | | not null | ||
| (GETDATE()) | | (GETDATE()) | ||
− | | Date and time the record was last updated. | + | | Date and time the record was last updated.<br /> |
|} | |} | ||
Line 203: | Line 274: | ||
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
|- style="background:silver" | |- style="background:silver" | ||
− | | ''' | + | | '''Dependency Type |
| '''Object Type | | '''Object Type | ||
+ | | '''Referenced Object | ||
+ | |||
+ | |- | ||
+ | | Schema | ||
+ | | Schema | ||
+ | | [[Sales_(schema)|Sales]] | ||
+ | |||
+ | |} | ||
+ | |||
+ | |||
+ | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
+ | |- style="background:silver" | ||
| '''Reference Type | | '''Reference Type | ||
− | + | | '''Object Type | |
+ | | '''Referencing Object | ||
+ | |||
|- | |- | ||
+ | | Select | ||
+ | | View | ||
| [[Sales.vIndividualCustomer_(view)|Sales.vIndividualCustomer]] | | [[Sales.vIndividualCustomer_(view)|Sales.vIndividualCustomer]] | ||
+ | |||
+ | |- | ||
+ | | Select | ||
| View | | View | ||
− | |||
− | |||
| [[Sales.vStoreWithDemographics_(view)|Sales.vStoreWithDemographics]] | | [[Sales.vStoreWithDemographics_(view)|Sales.vStoreWithDemographics]] | ||
− | + | ||
− | |||
|} | |} |
Latest revision as of 09:56, 27 August 2011
Contents
wikibot[edit]
Table | Sales.Customer |
Description | Current customer information. Also see the Individual and Store tables. |
Columns[edit]
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[edit]
Primary Key | Columns |
PK_Customer_CustomerID | CustomerID |
Indexes[edit]
Index | Type | Columns |
AK_Customer_AccountNumber | Unique | AccountNumber |
AK_Customer_rowguid | Unique | rowguid |
IX_Customer_TerritoryID | TerritoryID |
Check Constraints[edit]
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[edit]
Relation | Column | Referenced Column |
Sales.SalesTerritory | TerritoryID | TerritoryID |
Detail Tables[edit]
Detail Table | Column | Referencing Column |
Sales.CustomerAddress | CustomerID | CustomerID |
Sales.Individual | CustomerID | CustomerID |
Sales.SalesOrderHeader | CustomerID | CustomerID |
Sales.Store | CustomerID | CustomerID |
References[edit]
Dependency Type | Object Type | Referenced Object |
Schema | Schema | Sales |
Dependencies[edit]
Reference Type | Object Type | Referencing Object |
Select | View | Sales.vIndividualCustomer |
Select | View | Sales.vStoreWithDemographics |
automatically generated[edit]
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 |