Description
Work shift lookup table.
Table properties
| name | value |
|---|
| name | [HumanResources].[Shift] |
| created | Mar 19 2009 9:08PM |
| modified | Mar 19 2009 9:08PM
|
| ansi nulls | on
|
| quoted identifier | on
|
| row count | 3 |
| Size of data | 8 kb |
| Size of indexes | 40 kb |
| Maximum size of a single row | 225 bytes |
Columns
| column | datatype | length | bytes | default | nulls | PK | FK | UQ | computed | comment |
|---|
| ShiftID | tinyint identity(1,1) | 3 | 1 | | no
| yes
| |
| no
| Primary key for Shift records.
|
| Name | Name | 50 | 200 | | no
|
| |
| no
| Shift description.
|
| StartTime | datetime | 23 | 8 | | no
|
| |
| no
| Shift start time.
|
| EndTime | datetime | 23 | 8 | | no
|
| |
| no
| Shift end time.
|
| ModifiedDate | datetime | 23 | 8 | (getdate()) | no
|
| |
| no
| Date and time the record was last updated.
|
Indexes
| name | description | column | comment |
|---|
| AK_Shift_Name | nonclustered, unique located on PRIMARY | Name | Unique nonclustered index.
|
| AK_Shift_StartTime_EndTime | nonclustered, unique located on PRIMARY | StartTime, EndTime | Unique nonclustered index.
|
| PK_Shift_ShiftID | clustered, unique, primary key located on PRIMARY | ShiftID | Clustered index created by a primary key constraint.
|
Referenced by
Foreign key graph
Defaults
Dependency graph
Objects that [HumanResources].[Shift] depends on
| name | object type | level |
|---|
| Name | type | 1 |
Objects that depend on [HumanResources].[Shift]
Sample rows
| ShiftID | Name | StartTime | EndTime | ModifiedDate |
|---|
| 1
| Day
| 1/1/1900 7:00:00 AM
| 1/1/1900 3:00:00 PM
| 6/1/1998 12:00:00 AM
|
| 2
| Evening
| 1/1/1900 3:00:00 PM
| 1/1/1900 11:00:00 PM
| 6/1/1998 12:00:00 AM
|
| 3
| Night
| 1/1/1900 11:00:00 PM
| 1/1/1900 7:00:00 AM
| 6/1/1998 12:00:00 AM
|
Code
CREATE TABLE [HumanResources].[Shift](
[ShiftID] [tinyint] IDENTITY(1,1) NOT NULL,
[Name] [dbo].[Name] NOT NULL,
[ShiftID] [tinyint] IDENTITY(1,1) NOT NULL,
[StartTime] [datetime] NOT NULL,
[EndTime] [datetime] NOT NULL,
[ModifiedDate] [datetime] NOT NULL,
CONSTRAINT [PK_Shift_ShiftID] PRIMARY KEY CLUSTERED
(
[ShiftID] 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].[Shift] ADD CONSTRAINT [DF_Shift_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate]