Sales |
04/26/2006 |
PRIMARY |
824 |
1176 |
19185 |
Current customer information. Also see the Individual and Store tables. |
|
|
CustomerID |
int |
4 |
|
|
|
|
Primary key for Customer records. |
|
|
TerritoryID |
int |
4 |
|
|
|
|
ID of the territory in which the customer is located. Foreign key to SalesTerritory.SalesTerritoryID. |
|
|
AccountNumber |
varchar |
10 |
|
|
|
|
Unique number identifying the customer assigned by the accounting system. |
|
|
CustomerType |
nchar |
1 |
|
|
|
|
Customer type: I = Individual, S = Store |
|
|
rowguid |
uniqueidentifier |
16 |
|
(newid()) |
|
|
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
|
|
ModifiedDate |
datetime |
8 |
|
(getdate()) |
|
|
Date and time the record was last updated. |
Total: 6 column(s)
|
CustomerID |
1 |
1 |
|
Total: 4 index(es)
|
CK_Customer_CustomerType |
(upper([CustomerType])='I' OR upper([CustomerType])='S') |
Total: 1 constraint(s)
Total: 4 table(s)
Total: 1 table(s)
Total: 3 object(s)
Total: 16 object(s)
CREATE TABLE [Customer] (
[CustomerID] [int] IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL ,
[TerritoryID] [int] NULL ,
[AccountNumber] AS (isnull('AW'+[dbo].[ufnLeadingZeros]([CustomerID]),'')) ,
[CustomerType] [nchar] (1) COLLATE Latin1_General_CS_AS NOT NULL ,
[rowguid] uniqueidentifier ROWGUIDCOL NOT NULL CONSTRAINT [DF_Customer_rowguid] DEFAULT (newid()),
[ModifiedDate] [datetime] NOT NULL CONSTRAINT [DF_Customer_ModifiedDate] DEFAULT (getdate()),
CONSTRAINT [PK_Customer_CustomerID] PRIMARY KEY CLUSTERED
(
[CustomerID]
) ON [PRIMARY] ,
CONSTRAINT [FK_Customer_SalesTerritory_TerritoryID] FOREIGN KEY
(
[TerritoryID]
) REFERENCES [SalesTerritory] (
[TerritoryID]
),
CONSTRAINT [CK_Customer_CustomerType] CHECK (upper([CustomerType])='I' OR upper([CustomerType])='S')
) ON [PRIMARY]
GO
List of tables