Sales.Customer Table
Information
| Name | Customer |
| Schema | Sales |
| Row Count | 0 |
| Data Size | |
| Index Size | |
| Reserved Size | |
| Unused Size | |
| Created | 29.3.2010. 21:58:18 |
| Modified | 29.3.2010. 21:58:55 |
Extended Properties
| Name | Type | Property Name | Value |
| Customer | TABLE | MS_Description | Current customer information. Also see the Individual and Store tables. |
Columns
| PK | Key | Identity | Name | Data Type | Allow Nulls | Collation | References | Default | Computed | Compute Expression |
|   |   |   | CustomerID | int |   | | | |   | |
| |   |   | TerritoryID | int |   | | Sales.SalesTerritory.TerritoryID | |   | |
| |   |   | AccountNumber | varchar(10) |   | SQL_Latin1_General_CP1_CI_AS | | |   | (isnull('AW'+[dbo].[ufnLeadingZeros]([CustomerID]),'')) |
| |   |   | CustomerType | nchar(1) |   | SQL_Latin1_General_CP1_CI_AS | | |   | |
| |   |   | rowguid | uniqueidentifier |   | | | (newid()) |   | |
| |   |   | ModifiedDate | datetime |   | | | (getdate()) |   | |
Indexes
Check Constraints
| Name | Column | Enabled | Trusted | Expression |
| CK_Customer_CustomerType | CustomerType |   |   | (upper([CustomerType])='I' OR upper([CustomerType])='S') |
Foreign Key Constraints
SQL Script
CREATE TABLE [Sales].[Customer] (
[CustomerID] int NOT NULL IDENTITY,
[TerritoryID] int NULL,
[AccountNumber] varchar(10) NOT NULL,
[CustomerType] nchar(1) NOT NULL,
[rowguid] uniqueidentifier NOT NULL DEFAULT (newid()),
[ModifiedDate] datetime NOT NULL DEFAULT (getdate())
);
CREATE UNIQUE INDEX [AK_Customer_rowguid] on [Sales].[Customer]([rowguid]);
CREATE UNIQUE INDEX [AK_Customer_AccountNumber] on [Sales].[Customer]([AccountNumber]);
CREATE INDEX [IX_Customer_TerritoryID] on [Sales].[Customer]([TerritoryID]);