Table: [AdventureWorks2016CTP3].[HumanResources].[EmployeePayHistory]

CollapseAll image

Collapse image Table properties


Name  Value 
 Schema  [HumanResources]
 Owner  [dbo]
 Table is replicated   
 Creation date  23.10.2015
 ID  1813581499
 Located on  PRIMARY
 Data size KB  16 KB
 Index size KB  16 KB
 Rows  316
 ChangeTrackingEnabled   
 FileStreamFileGroup   
 FileStreamPartitionScheme   
 LockEscalation  TABLE
 TrackColumnsUpdatedEnabled   
 Table is filetable   
 Filetable directory   
 Filetable collate   
 Filetable primary key  [PK_EmployeePayHistory_BusinessEntityID_RateChangeDate]
 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        
Primary key   RateChangeDate     datetime 8        
    Rate     money 8        
    PayFrequency     tinyint 1        
    ModifiedDate     datetime 8   (getdate())    
Total: 5 column(s)

Collapse image Indexes


Index  Description  Primary  Unique  Size KB 
[PK_EmployeePayHistory_BusinessEntityID_RateChangeDate] BusinessEntityID   32 0
Total: 1 Index/indexes

Collapse image Columnstore indexes


No columnstore indexes exist

Collapse image Check constraints


Name  Expression 
CK_EmployeePayHistory_PayFrequency ([PayFrequency]=(2) OR [PayFrequency]=(1))
CK_EmployeePayHistory_Rate ([Rate]>=(6.50) AND [Rate]<=(200.00))

Collapse image Referenced tables


Table  Primary key or unique constraint  Foreign key 
[HumanResources].[Employee] PK_Employee_BusinessEntityID FK_EmployeePayHistory_Employee_BusinessEntityID
Total: 1 table(s)

Collapse image Triggers


Name  Schema  Description  Instead 
of 
For 
insert 
For 
update 
For 
delete 
Table/view 
[HumanResources].[tr_d_AUDIT_EmployeePayHistory] [HumanResources]         For Delete [HumanResources].[EmployeePayHistory]
[HumanResources].[tr_i_AUDIT_EmployeePayHistory] [HumanResources]     For Insert     [HumanResources].[EmployeePayHistory]
[HumanResources].[tr_u_AUDIT_EmployeePayHistory] [HumanResources]       For Update   [HumanResources].[EmployeePayHistory]
Total: 3 triggers(s)

Collapse image Objects that depend on [HumanResources].[EmployeePayHistory]


Object name Object type Dep level
[HumanResources].[uspUpdateEmployeeHireInfo] Procedure 1
[HumanResources].[tr_d_AUDIT_EmployeePayHistory] Trigger 1
[HumanResources].[tr_i_AUDIT_EmployeePayHistory] Trigger 1
[HumanResources].[tr_u_AUDIT_EmployeePayHistory] Trigger 1
Total 4 object(s)

Collapse image Objects that [HumanResources].[EmployeePayHistory] depends on


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

Collapse image Extended properties


Name  Value 
MS_Description Employee pay history.

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 [HumanResources].[EmployeePayHistory] (
        [BusinessEntityID]     [int] NOT NULL,
        [RateChangeDate]       [datetime] NOT NULL,
        [Rate]                 [money] NOT NULL,
        [PayFrequency]         [tinyint] NOT NULL,
        [ModifiedDate]         [datetime] NOT NULL,
        CONSTRAINT [PK_EmployeePayHistory_BusinessEntityID_RateChangeDate]
        PRIMARY KEY
        CLUSTERED
        ([BusinessEntityID], [RateChangeDate])
    ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Primary key (clustered) constraint', 'SCHEMA', N'HumanResources', 'TABLE', N'EmployeePayHistory', 'CONSTRAINT', N'PK_EmployeePayHistory_BusinessEntityID_RateChangeDate'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Clustered index created by a primary key constraint.', 'SCHEMA', N'HumanResources', 'TABLE', N'EmployeePayHistory', 'INDEX', N'PK_EmployeePayHistory_BusinessEntityID_RateChangeDate'
GO
ALTER TABLE [HumanResources].[EmployeePayHistory]
    ADD
    CONSTRAINT [CK_EmployeePayHistory_PayFrequency]
    CHECK
    ([PayFrequency]=(2) OR [PayFrequency]=(1))
GO
EXEC sp_addextendedproperty N'MS_Description', N'Check constraint [PayFrequency]=(3) OR [PayFrequency]=(2) OR [PayFrequency]=(1)', 'SCHEMA', N'HumanResources', 'TABLE', N'EmployeePayHistory', 'CONSTRAINT', N'CK_EmployeePayHistory_PayFrequency'
GO
ALTER TABLE [HumanResources].[EmployeePayHistory]
CHECK CONSTRAINT [CK_EmployeePayHistory_PayFrequency]
GO
ALTER TABLE [HumanResources].[EmployeePayHistory]
    ADD
    CONSTRAINT [CK_EmployeePayHistory_Rate]
    CHECK
    ([Rate]>=(6.50) AND [Rate]<=(200.00))
GO
EXEC sp_addextendedproperty N'MS_Description', N'Check constraint [Rate] >= (6.50) AND [Rate] <= (200.00)', 'SCHEMA', N'HumanResources', 'TABLE', N'EmployeePayHistory', 'CONSTRAINT', N'CK_EmployeePayHistory_Rate'
GO
ALTER TABLE [HumanResources].[EmployeePayHistory]
CHECK CONSTRAINT [CK_EmployeePayHistory_Rate]
GO
ALTER TABLE [HumanResources].[EmployeePayHistory]
    ADD
    CONSTRAINT [DF_EmployeePayHistory_ModifiedDate]
    DEFAULT (getdate()) FOR [ModifiedDate]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Default constraint value of GETDATE()', 'SCHEMA', N'HumanResources', 'TABLE', N'EmployeePayHistory', 'CONSTRAINT', N'DF_EmployeePayHistory_ModifiedDate'
GO
ALTER TABLE [HumanResources].[EmployeePayHistory]
    WITH CHECK
    ADD CONSTRAINT [FK_EmployeePayHistory_Employee_BusinessEntityID]
    FOREIGN KEY ([BusinessEntityID]) REFERENCES [HumanResources].[Employee] ([BusinessEntityID])
ALTER TABLE [HumanResources].[EmployeePayHistory]
    CHECK CONSTRAINT [FK_EmployeePayHistory_Employee_BusinessEntityID]

GO
EXEC sp_addextendedproperty N'MS_Description', N'Foreign key constraint referencing Employee.EmployeeID.', 'SCHEMA', N'HumanResources', 'TABLE', N'EmployeePayHistory', 'CONSTRAINT', N'FK_EmployeePayHistory_Employee_BusinessEntityID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Employee identification number. Foreign key to Employee.BusinessEntityID.', 'SCHEMA', N'HumanResources', 'TABLE', N'EmployeePayHistory', 'COLUMN', N'BusinessEntityID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Date and time the record was last updated.', 'SCHEMA', N'HumanResources', 'TABLE', N'EmployeePayHistory', 'COLUMN', N'ModifiedDate'
GO
EXEC sp_addextendedproperty N'MS_Description', N'1 = Salary received monthly, 2 = Salary received biweekly', 'SCHEMA', N'HumanResources', 'TABLE', N'EmployeePayHistory', 'COLUMN', N'PayFrequency'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Salary hourly rate.', 'SCHEMA', N'HumanResources', 'TABLE', N'EmployeePayHistory', 'COLUMN', N'Rate'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Date the change in pay is effective', 'SCHEMA', N'HumanResources', 'TABLE', N'EmployeePayHistory', 'COLUMN', N'RateChangeDate'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Employee pay history.', 'SCHEMA', N'HumanResources', 'TABLE', N'EmployeePayHistory', NULL, NULL
GO

Collapse image See also


List of tables