Table: [AdventureWorks2016CTP3].[Sales].[SalesPerson]

CollapseAll image

Collapse image Table properties


Name  Value 
 Schema  [Sales]
 Owner  [dbo]
 Table is replicated   
 Creation date  23.10.2015
 ID  1874105717
 Located on  PRIMARY
 Data size KB  8 KB
 Index size KB  24 KB
 Rows  17
 ChangeTrackingEnabled   
 FileStreamFileGroup   
 FileStreamPartitionScheme   
 LockEscalation  TABLE
 TrackColumnsUpdatedEnabled   
 Table is filetable   
 Filetable directory   
 Filetable collate   
 Filetable primary key  [PK_SalesPerson_BusinessEntityID]
 Filetable streamid unique   
 Filetable fullpath unique   
 Filetable is enabled   
 Is memory optimized   
 Durability  SCHEMA_AND_DATA

Collapse image Creation options


Name  Value 
QUOTED_IDENTIFIER ON
ANSI_NULLS ON
ANSI_PADDING OFF

Collapse image Columns


    Name  Description  Data type  Max length  Nullable  Default IsGUID  SPARSE Computed value
Primary key Foreign key BusinessEntityID     int 4        
  Foreign key TerritoryID     int 4      
    SalesQuota     money 8      
    Bonus     money 8   ((0.00))    
    CommissionPct     smallmoney 4   ((0.00))    
    SalesYTD     money 8   ((0.00))    
    SalesLastYear     money 8   ((0.00))    
    rowguid     uniqueidentifier 16   (newid())  
    ModifiedDate     datetime 8   (getdate())    
Total: 9 column(s)

Collapse image Indexes


Index  Description  Primary  Unique  Size KB 
[PK_SalesPerson_BusinessEntityID] BusinessEntityID   32 0
[AK_SalesPerson_rowguid] rowguid     16 0
Total: 2 Index/indexes

Collapse image Columnstore indexes


No columnstore indexes exist

Collapse image 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))

Collapse image Referencing tables


Table  Foreign key  Primary key or unique constraint 
[Sales].[SalesOrderHeader] FK_SalesOrderHeader_SalesPerson_SalesPersonID PK_SalesPerson_BusinessEntityID
[Sales].[SalesPersonQuotaHistory] FK_SalesPersonQuotaHistory_SalesPerson_BusinessEntityID PK_SalesPerson_BusinessEntityID
[Sales].[SalesTerritoryHistory] FK_SalesTerritoryHistory_SalesPerson_BusinessEntityID PK_SalesPerson_BusinessEntityID
[Sales].[Store] FK_Store_SalesPerson_SalesPersonID PK_SalesPerson_BusinessEntityID
Total: 4 table(s)

Collapse image Referenced tables


Table  Primary key or unique constraint  Foreign key 
[HumanResources].[Employee] PK_Employee_BusinessEntityID FK_SalesPerson_Employee_BusinessEntityID
[Sales].[SalesTerritory] PK_SalesTerritory_TerritoryID FK_SalesPerson_SalesTerritory_TerritoryID
Total: 2 table(s)

Collapse image Objects that depend on [Sales].[SalesPerson]


Object name Object type Dep level
[Sales].[SalesOrderHeader] Table 1
[Sales].[SalesPersonQuotaHistory] Table 1
[Sales].[SalesTerritoryHistory] Table 1
[Sales].[Store] Table 1
[Sales].[uSalesOrderHeader] Trigger 1
[Security].[customerAccessPredicate] Function 1
[Sales].[vSalesPerson] View 1
[Sales].[vSalesPersonSalesByFiscalYears] View 1
Total 8 object(s)

Collapse image Objects that [Sales].[SalesPerson] depends on


Object name Object type Dep level
[Sales] Schema 1
[HumanResources].[Employee] Table 1
[Sales].[SalesTerritory] Table 1
Total 3 object(s)

Collapse image Extended properties


Name  Value 
MS_Description Sales representative current information.

Collapse image Table options


Name  Value 
Pintable OFF
Table lock on bulk load OFF
Insert row lock OFF
Text in row 0
Large value types out of row OFF

Collapse image SQL


SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
SET ANSI_PADDING OFF
GO
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] NOT NULL ROWGUIDCOL,
        [ModifiedDate]         [datetime] NOT NULL,
        CONSTRAINT [PK_SalesPerson_BusinessEntityID]
        PRIMARY KEY
        CLUSTERED
        ([BusinessEntityID])
    ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Primary key (clustered) constraint', 'SCHEMA', N'Sales', 'TABLE', N'SalesPerson', 'CONSTRAINT', N'PK_SalesPerson_BusinessEntityID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Clustered index created by a primary key constraint.', 'SCHEMA', N'Sales', 'TABLE', N'SalesPerson', 'INDEX', N'PK_SalesPerson_BusinessEntityID'
GO
ALTER TABLE [Sales].[SalesPerson]
    ADD
    CONSTRAINT [CK_SalesPerson_Bonus]
    CHECK
    ([Bonus]>=(0.00))
GO
EXEC sp_addextendedproperty N'MS_Description', N'Check constraint [Bonus] >= (0.00)', 'SCHEMA', N'Sales', 'TABLE', N'SalesPerson', 'CONSTRAINT', N'CK_SalesPerson_Bonus'
GO
ALTER TABLE [Sales].[SalesPerson]
CHECK CONSTRAINT [CK_SalesPerson_Bonus]
GO
ALTER TABLE [Sales].[SalesPerson]
    ADD
    CONSTRAINT [CK_SalesPerson_CommissionPct]
    CHECK
    ([CommissionPct]>=(0.00))
GO
EXEC sp_addextendedproperty N'MS_Description', N'Check constraint [CommissionPct] >= (0.00)', 'SCHEMA', N'Sales', 'TABLE', N'SalesPerson', 'CONSTRAINT', N'CK_SalesPerson_CommissionPct'
GO
ALTER TABLE [Sales].[SalesPerson]
CHECK CONSTRAINT [CK_SalesPerson_CommissionPct]
GO
ALTER TABLE [Sales].[SalesPerson]
    ADD
    CONSTRAINT [CK_SalesPerson_SalesLastYear]
    CHECK
    ([SalesLastYear]>=(0.00))
GO
EXEC sp_addextendedproperty N'MS_Description', N'Check constraint [SalesLastYear] >= (0.00)', 'SCHEMA', N'Sales', 'TABLE', N'SalesPerson', 'CONSTRAINT', N'CK_SalesPerson_SalesLastYear'
GO
ALTER TABLE [Sales].[SalesPerson]
CHECK CONSTRAINT [CK_SalesPerson_SalesLastYear]
GO
ALTER TABLE [Sales].[SalesPerson]
    ADD
    CONSTRAINT [CK_SalesPerson_SalesQuota]
    CHECK
    ([SalesQuota]>(0.00))
GO
EXEC sp_addextendedproperty N'MS_Description', N'Check constraint [SalesQuota] > (0.00)', 'SCHEMA', N'Sales', 'TABLE', N'SalesPerson', 'CONSTRAINT', N'CK_SalesPerson_SalesQuota'
GO
ALTER TABLE [Sales].[SalesPerson]
CHECK CONSTRAINT [CK_SalesPerson_SalesQuota]
GO
ALTER TABLE [Sales].[SalesPerson]
    ADD
    CONSTRAINT [CK_SalesPerson_SalesYTD]
    CHECK
    ([SalesYTD]>=(0.00))
GO
EXEC sp_addextendedproperty N'MS_Description', N'Check constraint [SalesYTD] >= (0.00)', 'SCHEMA', N'Sales', 'TABLE', N'SalesPerson', 'CONSTRAINT', N'CK_SalesPerson_SalesYTD'
GO
ALTER TABLE [Sales].[SalesPerson]
CHECK CONSTRAINT [CK_SalesPerson_SalesYTD]
GO
ALTER TABLE [Sales].[SalesPerson]
    ADD
    CONSTRAINT [DF_SalesPerson_Bonus]
    DEFAULT ((0.00)) FOR [Bonus]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Default constraint value of 0.0', 'SCHEMA', N'Sales', 'TABLE', N'SalesPerson', 'CONSTRAINT', N'DF_SalesPerson_Bonus'
GO
ALTER TABLE [Sales].[SalesPerson]
    ADD
    CONSTRAINT [DF_SalesPerson_CommissionPct]
    DEFAULT ((0.00)) FOR [CommissionPct]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Default constraint value of 0.0', 'SCHEMA', N'Sales', 'TABLE', N'SalesPerson', 'CONSTRAINT', N'DF_SalesPerson_CommissionPct'
GO
ALTER TABLE [Sales].[SalesPerson]
    ADD
    CONSTRAINT [DF_SalesPerson_ModifiedDate]
    DEFAULT (getdate()) FOR [ModifiedDate]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Default constraint value of GETDATE()', 'SCHEMA', N'Sales', 'TABLE', N'SalesPerson', 'CONSTRAINT', N'DF_SalesPerson_ModifiedDate'
GO
ALTER TABLE [Sales].[SalesPerson]
    ADD
    CONSTRAINT [DF_SalesPerson_rowguid]
    DEFAULT (newid()) FOR [rowguid]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Default constraint value of NEWID()', 'SCHEMA', N'Sales', 'TABLE', N'SalesPerson', 'CONSTRAINT', N'DF_SalesPerson_rowguid'
GO
ALTER TABLE [Sales].[SalesPerson]
    ADD
    CONSTRAINT [DF_SalesPerson_SalesLastYear]
    DEFAULT ((0.00)) FOR [SalesLastYear]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Default constraint value of 0.0', 'SCHEMA', N'Sales', 'TABLE', N'SalesPerson', 'CONSTRAINT', N'DF_SalesPerson_SalesLastYear'
GO
ALTER TABLE [Sales].[SalesPerson]
    ADD
    CONSTRAINT [DF_SalesPerson_SalesYTD]
    DEFAULT ((0.00)) FOR [SalesYTD]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Default constraint value of 0.0', 'SCHEMA', N'Sales', 'TABLE', N'SalesPerson', 'CONSTRAINT', N'DF_SalesPerson_SalesYTD'
GO
ALTER TABLE [Sales].[SalesPerson]
    WITH CHECK
    ADD CONSTRAINT [FK_SalesPerson_Employee_BusinessEntityID]
    FOREIGN KEY ([BusinessEntityID]) REFERENCES [HumanResources].[Employee] ([BusinessEntityID])
ALTER TABLE [Sales].[SalesPerson]
    CHECK CONSTRAINT [FK_SalesPerson_Employee_BusinessEntityID]

GO
EXEC sp_addextendedproperty N'MS_Description', N'Foreign key constraint referencing Employee.EmployeeID.', 'SCHEMA', N'Sales', 'TABLE', N'SalesPerson', 'CONSTRAINT', N'FK_SalesPerson_Employee_BusinessEntityID'
GO
ALTER TABLE [Sales].[SalesPerson]
    WITH CHECK
    ADD CONSTRAINT [FK_SalesPerson_SalesTerritory_TerritoryID]
    FOREIGN KEY ([TerritoryID]) REFERENCES [Sales].[SalesTerritory] ([TerritoryID])
ALTER TABLE [Sales].[SalesPerson]
    CHECK CONSTRAINT [FK_SalesPerson_SalesTerritory_TerritoryID]

GO
EXEC sp_addextendedproperty N'MS_Description', N'Foreign key constraint referencing SalesTerritory.TerritoryID.', 'SCHEMA', N'Sales', 'TABLE', N'SalesPerson', 'CONSTRAINT', N'FK_SalesPerson_SalesTerritory_TerritoryID'
GO
CREATE UNIQUE NONCLUSTERED INDEX [AK_SalesPerson_rowguid]
    ON [Sales].[SalesPerson] ([rowguid])
    ON [PRIMARY]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Unique nonclustered index. Used to support replication samples.', 'SCHEMA', N'Sales', 'TABLE', N'SalesPerson', 'INDEX', N'AK_SalesPerson_rowguid'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Bonus due if quota is met.', 'SCHEMA', N'Sales', 'TABLE', N'SalesPerson', 'COLUMN', N'Bonus'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Primary key for SalesPerson records. Foreign key to Employee.BusinessEntityID', 'SCHEMA', N'Sales', 'TABLE', N'SalesPerson', 'COLUMN', N'BusinessEntityID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Commision percent received per sale.', 'SCHEMA', N'Sales', 'TABLE', N'SalesPerson', 'COLUMN', N'CommissionPct'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Date and time the record was last updated.', 'SCHEMA', N'Sales', 'TABLE', N'SalesPerson', 'COLUMN', N'ModifiedDate'
GO
EXEC sp_addextendedproperty N'MS_Description', N'ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.', 'SCHEMA', N'Sales', 'TABLE', N'SalesPerson', 'COLUMN', N'rowguid'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Sales total of previous year.', 'SCHEMA', N'Sales', 'TABLE', N'SalesPerson', 'COLUMN', N'SalesLastYear'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Projected yearly sales.', 'SCHEMA', N'Sales', 'TABLE', N'SalesPerson', 'COLUMN', N'SalesQuota'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Sales total year to date.', 'SCHEMA', N'Sales', 'TABLE', N'SalesPerson', 'COLUMN', N'SalesYTD'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Territory currently assigned to. Foreign key to SalesTerritory.SalesTerritoryID.', 'SCHEMA', N'Sales', 'TABLE', N'SalesPerson', 'COLUMN', N'TerritoryID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Sales representative current information.', 'SCHEMA', N'Sales', 'TABLE', N'SalesPerson', NULL, NULL
GO

Collapse image See also


List of tables