Description
Properties
Creation Date | 08/01/2010 08:40 |
File Group | PRIMARY |
Text File Group | |
System Object |  |
Published for Replication |  |
Rows | 316 |
Data Space Used | 16.00 KB |
Index Space Used | 16.00 KB |
Columns
| Column Name | Description | Datatype | Length | Allow Nulls | Default | Formula |
| EmployeeID | Employee identification number. Foreign key to Employee.EmployeeID. | int | 4 | | | |
| RateChangeDate | Date the change in pay is effective | datetime | 4 | | | |
| Rate | Salary hourly rate. | money | 8 | | | |
| PayFrequency | 1 = Salary received monthly, 2 = Salary received biweekly | tinyint | 1 | | | |
| ModifiedDate | Date and time the record was last updated. | datetime | 4 | | (getdate()) | |
Indexes
Check Constraints
Name | Description | Expression |
CK_EmployeePayHistory_PayFrequency | Check constraint [PayFrequency]=(3) OR [PayFrequency]=(2) OR [PayFrequency]=(1) | ([PayFrequency]=(2) OR [PayFrequency]=(1)) |
CK_EmployeePayHistory_Rate | Check constraint [Rate] >= (6.50) AND [Rate] <= (200.00) | ([Rate]>=(6.50) AND [Rate]<=(200.00)) |
Relationships
Objects that depend on HumanResources.EmployeePayHistory
| Database Object | Object Type | Description | Dep Level |
 | HumanResources.uspUpdateEmployeeHireInfo | Stored Procedure | Updates the Employee table and inserts a new row in the EmployeePayHistory table with the values specified in the input parameters. | 1 |
Objects that HumanResources.EmployeePayHistory depends on
SQL
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE TABLE [HumanResources].[EmployeePayHistory](
[EmployeeID] [int] NOT NULL,
[RateChangeDate] [datetime] NOT NULL,
[Rate] [money] NOT NULL,
[PayFrequency] [tinyint] NOT NULL,
[ModifiedDate] [datetime] NOT NULL,
CONSTRAINT [PK_EmployeePayHistory_EmployeeID_RateChangeDate] PRIMARY KEY CLUSTERED
(
[EmployeeID] ASC,
[RateChangeDate] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
ALTER TABLE [HumanResources].[EmployeePayHistory] WITH CHECK ADD CONSTRAINT [FK_EmployeePayHistory_Employee_EmployeeID] FOREIGN KEY([EmployeeID])
REFERENCES [Employee] ([EmployeeID])
ALTER TABLE [HumanResources].[EmployeePayHistory] CHECK CONSTRAINT [FK_EmployeePayHistory_Employee_EmployeeID]
ALTER TABLE [HumanResources].[EmployeePayHistory] WITH CHECK ADD CONSTRAINT [CK_EmployeePayHistory_PayFrequency] CHECK (([PayFrequency]=(2) OR [PayFrequency]=(1)))
ALTER TABLE [HumanResources].[EmployeePayHistory] CHECK CONSTRAINT [CK_EmployeePayHistory_PayFrequency]
ALTER TABLE [HumanResources].[EmployeePayHistory] WITH CHECK ADD CONSTRAINT [CK_EmployeePayHistory_Rate] CHECK (([Rate]>=(6.50) AND [Rate]<=(200.00)))
ALTER TABLE [HumanResources].[EmployeePayHistory] CHECK CONSTRAINT [CK_EmployeePayHistory_Rate]
ALTER TABLE [HumanResources].[EmployeePayHistory] ADD CONSTRAINT [DF_EmployeePayHistory_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate]
|
See Also