# Table: SalesPerson

## Properties

Property | Value
--- | ---
Name | SalesPerson
ID | 1298103665
Owner | dbo
Schema | Sales
Filegroup | PRIMARY
Data Size (KB) | 8 KB
Index Size (KB) | 24 KB
Rows | 17
Unused (KB) | 0 KB
ANSI Null On |
Quoted Identifier |
Lock Escalation | TABLE
Lock On Bulk Load |
Lob Data Space |
Filestream Data Space ID |
Has Unchecked Assembly Data |
Text In Row Limit (bytes) | Option not set
Large Value Types Out Of Row |
FullText Change Tracking On |
Tracked By Cdc |
Published |
Schema Published |
Replicated |
Replication Filter |
Merge Published |
Sync Tran Subscribed |
MS Shipped |
Modify Date | 8/8/2010 5:23:43 PM
Create Date | 8/8/2010 5:21:52 PM

## Extended Properties

Name | Value
--- | ---
MS_Description | Sales representative current information.

## Columns

Column ID | Column Name | Datatype | Nullable | Is Sparse | Is Column Set
--- | --- | --- | --- | --- | ---
1 | BusinessEntityID | int |  |  |
2 | TerritoryID | int |  |  |
3 | SalesQuota | money |  |  |
4 | Bonus | money |  |  |
5 | CommissionPct | smallmoney |  |  |
6 | SalesYTD | money |  |  |
7 | SalesLastYear | money |  |  |
8 | rowguid | uniqueidentifier |  |  |
9 | ModifiedDate | datetime |  |  |

## Identity Columns

No identity columns defined.

## Primary Key Constraints

Name | Is System Named | Extended Property Name | Extended Property Value
--- | --- | --- | ---
PK_SalesPerson_BusinessEntityID |  | MS_Description | Primary key (clustered) constraint

## Primary Key Columns

Name
BusinessEntityID

## Foreign Keys

Name | Referenced Object | Update Action | Delete Action
--- | --- | --- | ---
FK_SalesPerson_Employee_BusinessEntityID | HumanResources.Employee | No action | No action
FK_SalesPerson_SalesTerritory_TerritoryID | Sales.SalesTerritory | No action | No action

## Column Level Check Constraints

Name | Column ID | Column | Definition | Is Disabled | Is Not For Replication | Is Not Trusted | Uses Database Collation | Is System Named
--- | --- | --- | --- | --- | --- | --- | --- | ---
CK_SalesPerson_SalesQuota | 3 | SalesQuota | ([SalesQuota]>(0.00)) |  |  |  |  |
CK_SalesPerson_Bonus | 4 | Bonus | ([Bonus]>=(0.00)) |  |  |  |  |
CK_SalesPerson_CommissionPct | 5 | CommissionPct | ([CommissionPct]>=(0.00)) |  |  |  |  |
CK_SalesPerson_SalesYTD | 6 | SalesYTD | ([SalesYTD]>=(0.00)) |  |  |  |  |
CK_SalesPerson_SalesLastYear | 7 | SalesLastYear | ([SalesLastYear]>=(0.00)) |  |  |  |  |

## Table Level Check Constraints

No table constraints defined.

## Default Constraints

Name | Column | Definition | Is System Named | Extended Property Name | Extended Property Value
--- | --- | --- | --- | --- | ---
DF_SalesPerson_Bonus | Bonus | ((0.00)) |  | MS_Description | Default constraint value of 0.0
DF_SalesPerson_CommissionPct | CommissionPct | ((0.00)) |  | MS_Description | Default constraint value of 0.0
DF_SalesPerson_SalesYTD | SalesYTD | ((0.00)) |  | MS_Description | Default constraint value of 0.0
DF_SalesPerson_SalesLastYear | SalesLastYear | ((0.00)) |  | MS_Description | Default constraint value of 0.0
DF_SalesPerson_rowguid | rowguid | (newid()) |  | MS_Description | Default constraint value of NEWID()
DF_SalesPerson_ModifiedDate | ModifiedDate | (getdate()) |  | MS_Description | Default constraint value of GETDATE()

## Indexes

Name | Index Type | Primary Key | Unique | Unique Constraint | Ignore Duplicate Key | Disabled
--- | --- | --- | --- | --- | --- | ---
PK_SalesPerson_BusinessEntityID | CLUSTERED |  |  |  |  |
AK_SalesPerson_rowguid | NONCLUSTERED |  |  |  |  |

## FullText Indexes

No fulltext indexes defined.

## Referencing Tables

Name | Key Index ID | Is Disabled | Is Not For Replication | Is Not Trusted | Delete Action | Update Action | Is System Named | Referencing Object
--- | --- | --- | --- | --- | --- | --- | --- | ---
FK_SalesOrderHeader_SalesPerson_SalesPersonID | 1 |  |  |  | No action | No action |  | Sales.SalesOrderHeader
FK_SalesPersonQuotaHistory_SalesPerson_BusinessEntityID | 1 |  |  |  | No action | No action |  | Sales.SalesPersonQuotaHistory
FK_SalesTerritoryHistory_SalesPerson_BusinessEntityID | 1 |  |  |  | No action | No action |  | Sales.SalesTerritoryHistory
FK_Store_SalesPerson_SalesPersonID | 1 |  |  |  | No action | No action |  | Sales.Store

## Object Level Permissions

No object level permissions defined.

## Column Level Permissions

No explicit column permissions granted to this object

## Statistics

### Detailed Statistics General

Name | Updated | Rows | Rows Sampled | Steps | Density | Average Key Length | String Index | Filter Expression | Unfiltered Rows
--- | --- | --- | --- | --- | --- | --- | --- | --- | ---
PK_SalesPerson_BusinessEntityID | Aug 8 2010 5:23PM | 17 | 17 | 9 | 1 | 4 |  |  | 17

### Detailed Statistics Density

All Density | Average Length | Columns
--- | --- | ---
0.05882353 | 4 | BusinessEntityID

### Detailed Statistics Histogram

Range High Key | Range Rows | Estimated Rows | Distinct Range Rows | Avg Range Rows
--- | --- | --- | --- | ---
274 | 0 | 1 | 0 | 1
276 | 1 | 1 | 1 | 1
278 | 1 | 1 | 1 | 1
280 | 1 | 1 | 1 | 1
282 | 1 | 1 | 1 | 1
284 | 1 | 1 | 1 | 1
286 | 1 | 1 | 1 | 1
288 | 1 | 1 | 1 | 1
290 | 1 | 1 | 1 | 1

### Detailed Statistics General

Name | Updated | Rows | Rows Sampled | Steps | Density | Average Key Length | String Index | Filter Expression | Unfiltered Rows
--- | --- | --- | --- | --- | --- | --- | --- | --- | ---
AK_SalesPerson_rowguid | Aug 8 2010 5:23PM | 17 | 17 | 15 | 1 | 20 |  |  | 17

### Detailed Statistics Density

All Density | Average Length | Columns
--- | --- | ---
0.05882353 | 16 | rowguid
0.05882353 | 20 | rowguid, BusinessEntityID

### Detailed Statistics Histogram

Range High Key | Range Rows | Estimated Rows | Distinct Range Rows | Avg Range Rows
--- | --- | --- | --- | ---
cfdbef27-b1f7-4a56-a878-0221c73bae67 | 0 | 1 | 0 | 1
6bac15b2-8ffb-45a9-b6d5-040e16c2073f | 0 | 1 | 0 | 1
7a0ae1ab-b283-40f9-91d1-167abf06d720 | 0 | 1 | 0 | 1
52a5179d-3239-4157-ae29-17e868296dc0 | 0 | 1 | 0 | 1
39012928-bfec-4242-874d-423162c3f567 | 0 | 1 | 0 | 1
1e0a7274-3064-4f58-88ee-4c6586c87169 | 0 | 1 | 0 | 1
224bb25a-62e3-493e-acaf-4f8f5c72396a | 0 | 1 | 0 | 1
1dd1f689-df74-4149-8600-59555eef154b | 0 | 1 | 0 | 1
31fd7fc1-dc84-4f05-b9a0-762519eacacc | 1 | 1 | 1 | 1
25f6838d-9db4-4833-9ddc-7a24283af1ba | 0 | 1 | 0 | 1
f509e3d4-76c8-42aa-b353-90b7b8db08de | 0 | 1 | 0 | 1
48754992-9ee0-4c0e-8c94-9451604e3e02 | 0 | 1 | 0 | 1
9b968777-75dc-45bd-a8df-9cdaa72839e1 | 0 | 1 | 0 | 1
ac94ec04-a2dc-43e3-8654-dd0c546abc17 | 1 | 1 | 1 | 1
35326ddb-7278-4fef-b3ba-ea137b69094e | 0 | 1 | 0 | 1

### Detailed Statistics General

Name | Updated | Rows | Rows Sampled | Steps | Density | Average Key Length | String Index | Filter Expression | Unfiltered Rows
--- | --- | --- | --- | --- | --- | --- | --- | --- | ---
_WA_Sys_00000002_4D5F7D71 | Aug 8 2010 5:23PM | 17 | 17 | 8 | 1 | 3.294118 |  |  | 17

### Detailed Statistics Density

All Density | Average Length | Columns
--- | --- | ---
0.09090909 | 3.294118 | TerritoryID

### Detailed Statistics Histogram

Range High Key | Range Rows | Estimated Rows | Distinct Range Rows | Avg Range Rows
--- | --- | --- | --- | ---
| 0 | 3 | 0 | 1
1 | 0 | 3 | 0 | 1
3 | 1 | 1 | 1 | 1
4 | 0 | 2 | 0 | 1
5 | 0 | 1 | 0 | 1
6 | 0 | 2 | 0 | 1
8 | 1 | 1 | 1 | 1
10 | 1 | 1 | 1 | 1

## Objects that depend on [SalesPerson]

- Sales.SalesPerson
  - Sales.SalesOrderHeader
    - Sales.SalesOrderDetail
      - Sales.iduSalesOrderDetail
      - Sales.ufn_SalesByStore
    - Sales.SalesOrderHeaderSalesReason
    - Sales.uSalesOrderHeader
    - Sales.vSalesPersonSalesByFiscalYears
  - Sales.SalesPersonQuotaHistory
  - Sales.SalesTerritoryHistory
  - Sales.Store
    - dbo.ufnGetContactInformation
    - Sales.Customer
      - Sales.vIndividualCustomer
    - Sales.vStoreWithAddresses
    - Sales.vStoreWithContacts
    - Sales.vStoreWithDemographics
  - Sales.vSalesPerson

## Objects on which [SalesPerson] depends

- Sales.SalesPerson
  - Sales.SalesTerritory
    - Person.CountryRegion
      - dbo.Name
  - HumanResources.Employee
    - Person.Person
      - Person.AdditionalContactInfoSchemaCollection
      - Person.BusinessEntity
      - Demographics.exist
      - Person.IndividualSurveySchemaCollection
      - dbo.NameStyle
    - dbo.Flag

## SQL

Script
SET ANSI_NULLS ON SET QUOTED_IDENTIFIER ON CREATE TABLE [Sales].[SalesPerson]( [BusinessEntityID] [int] NOT NULL, [TerritoryID] [int] NULL, [SalesQuota] [money] NULL, [Bonus] [money] NOT NULL, [CommissionPct] [smallmoney] NOT NULL, [SalesYTD] [money] NOT NULL, [SalesLastYear] [money] NOT NULL, [rowguid] [uniqueidentifier] ROWGUIDCOL NOT NULL, [ModifiedDate] [datetime] NOT NULL ) ON [PRIMARY] EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Primary key for SalesPerson records. Foreign key to Employee.BusinessEntityID' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'SalesPerson', @level2type=N'COLUMN',@level2name=N'BusinessEntityID' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Territory currently assigned to. Foreign key to SalesTerritory.SalesTerritoryID.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'SalesPerson', @level2type=N'COLUMN',@level2name=N'TerritoryID' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Projected yearly sales.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'SalesPerson', @level2type=N'COLUMN',@level2name=N'SalesQuota' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Bonus due if quota is met.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'SalesPerson', @level2type=N'COLUMN',@level2name=N'Bonus' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Commision percent received per sale.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'SalesPerson', @level2type=N'COLUMN',@level2name=N'CommissionPct' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Sales total year to date.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'SalesPerson', @level2type=N'COLUMN',@level2name=N'SalesYTD' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Sales total of previous year.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'SalesPerson', @level2type=N'COLUMN',@level2name=N'SalesLastYear' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'SalesPerson', @level2type=N'COLUMN',@level2name=N'rowguid' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Date and time the record was last updated.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'SalesPerson', @level2type=N'COLUMN',@level2name=N'ModifiedDate' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Sales representative current information.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'SalesPerson'

#### See also

List of Tables