Properties

Owner: Sales 
Creation Date: 04/26/2006 
Located On: PRIMARY 
Data Size KB:
Index Size KB: 24 
Rows: 17 
Description: Sales representative current information. 

Columns

Name Data Type Length NULL Default IsIdentity IsGUID Description
    SalesPersonID  int          Primary key for SalesPerson records. 
    TerritoryID  int          Territory currently assigned to. Foreign key to SalesTerritory.SalesTerritoryID. 
    SalesQuota  money          Projected yearly sales. 
    Bonus  money    ((0.00))      Bonus due if quota is met. 
    CommissionPct  smallmoney    ((0.00))      Commision percent received per sale. 
    SalesYTD  money    ((0.00))      Sales total year to date. 
    SalesLastYear  money    ((0.00))      Sales total of previous year. 
    rowguid  uniqueidentifier  16    (newid())      ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. 
    ModifiedDate  datetime    (getdate())      Date and time the record was last updated. 
Total: 9 column(s)

Indexes

Index Primary Unique Description
  PK_SalesPerson_SalesPersonID      Primary key (clustered) constraint 
  AK_SalesPerson_rowguid      Unique nonclustered index. Used to support replication samples. 
Total: 2 index(es)

Check Constraints

Name Expression
  CK_SalesPerson_Bonus  ([Bonus]>=(0.00)) 
  CK_SalesPerson_CommissionPct  ([CommissionPct]>=(0.00)) 
  CK_SalesPerson_SalesLastYear  ([SalesLastYear]>=(0.00)) 
  CK_SalesPerson_SalesQuota  ([SalesQuota]>(0.00)) 
  CK_SalesPerson_SalesYTD  ([SalesYTD]>=(0.00)) 
Total: 5 constraint(s)

Referencing Tables

Table Foreign Key Primary Key or Unique Constraint
  Sales.SalesOrderHeader  FK_SalesOrderHeader_SalesPerson_SalesPersonID  PK_SalesPerson_SalesPersonID 
  Sales.SalesPersonQuotaHistory  FK_SalesPersonQuotaHistory_SalesPerson_SalesPersonID  PK_SalesPerson_SalesPersonID 
  Sales.SalesTerritoryHistory  FK_SalesTerritoryHistory_SalesPerson_SalesPersonID  PK_SalesPerson_SalesPersonID 
  Sales.Store  FK_Store_SalesPerson_SalesPersonID  PK_SalesPerson_SalesPersonID 
Total: 4 table(s)

Referenced Tables

Table Foreign Key Primary Key or Unique Constraint
  HumanResources.Employee  FK_SalesPerson_Employee_SalesPersonID  PK_Employee_EmployeeID 
  Sales.SalesTerritory  FK_SalesPerson_SalesTerritory_TerritoryID  PK_SalesTerritory_TerritoryID 
Total: 2 table(s)

Objects that [Sales].[SalesPerson] depends on

Object Name Owner Object Type Dep Level
  Flag  dbo  User Defined type 
  Name  dbo  User Defined type 
  NameStyle  dbo  User Defined type 
  Phone  dbo  User Defined type 
  Contact  Person  Table 
  SalesTerritory  Sales  Table 
  Employee  HumanResources  Table 
Total: 7 object(s)

Objects that depend on [Sales].[SalesPerson]

Object Name Owner Object Type Dep Level
  vSalesPerson  Sales  View 
  SalesOrderHeader  Sales  Table 
  SalesPersonQuotaHistory  Sales  Table 
  SalesTerritoryHistory  Sales  Table 
  Store  Sales  Table 
  vSalesPersonSalesByFiscalYears  Sales  View 
  SalesOrderDetail  Sales  Table 
  SalesOrderHeaderSalesReason  Sales  Table 
  StoreContact  Sales  Table 
  iStore  Sales  Trigger 
  iuIndividual  Sales  Trigger 
  uSalesOrderHeader  Sales  Trigger 
  ufnGetContactInformation  dbo  Function 
  vStoreWithDemographics  Sales  View 
  iduSalesOrderDetail  Sales  Trigger 
Total: 15 object(s)

SQL

CREATE TABLE [SalesPerson] (
    [SalesPersonID] [int] NOT NULL ,
    [TerritoryID] [int] NULL ,
    [SalesQuota] [money] NULL ,
    [Bonus] [money] NOT NULL CONSTRAINT [DF_SalesPerson_Bonus] DEFAULT ((0.00)),
    [CommissionPct] [smallmoney] NOT NULL CONSTRAINT [DF_SalesPerson_CommissionPct] DEFAULT ((0.00)),
    [SalesYTD] [money] NOT NULL CONSTRAINT [DF_SalesPerson_SalesYTD] DEFAULT ((0.00)),
    [SalesLastYear] [money] NOT NULL CONSTRAINT [DF_SalesPerson_SalesLastYear] DEFAULT ((0.00)),
    [rowguid]  uniqueidentifier ROWGUIDCOL  NOT NULL CONSTRAINT [DF_SalesPerson_rowguid] DEFAULT (newid()),
    [ModifiedDate] [datetime] NOT NULL CONSTRAINT [DF_SalesPerson_ModifiedDate] DEFAULT (getdate()),
    CONSTRAINT [PK_SalesPerson_SalesPersonID] PRIMARY KEY  CLUSTERED
    (
        [SalesPersonID]
    )  ON [PRIMARY] ,
    CONSTRAINT [FK_SalesPerson_Employee_SalesPersonID] FOREIGN KEY
    (
        [SalesPersonID]
    ) REFERENCES [Employee] (
        [EmployeeID]
    ),
    CONSTRAINT [FK_SalesPerson_SalesTerritory_TerritoryID] FOREIGN KEY
    (
        [TerritoryID]
    ) REFERENCES [SalesTerritory] (
        [TerritoryID]
    ),
    CONSTRAINT [CK_SalesPerson_Bonus] CHECK ([Bonus]>=(0.00)),
    CONSTRAINT [CK_SalesPerson_CommissionPct] CHECK ([CommissionPct]>=(0.00)),
    CONSTRAINT [CK_SalesPerson_SalesLastYear] CHECK ([SalesLastYear]>=(0.00)),
    CONSTRAINT [CK_SalesPerson_SalesQuota] CHECK ([SalesQuota]>(0.00)),
    CONSTRAINT [CK_SalesPerson_SalesYTD] CHECK ([SalesYTD]>=(0.00))
) ON [PRIMARY]
GO


See Also

List of tables