Northwind Database (Document! X Sample)
AdventureWorks Database / HumanResources Schema / HumanResources.Shift Table
In This Topic
    HumanResources.Shift Table
    In This Topic
    Description
    Work shift lookup table.
    Properties
    Creation Date27/10/2017 14:33
    File GroupPRIMARY
    Text File Group
    System Object
    Published for Replication
    Rows3
    Data Space Used8.00 KB
    Index Space Used40.00 KB
    Columns
     Column NameDescriptionDatatypeLengthAllow NullsDefaultFormula
    Primary Key Primary key for Shift records.UnsignedTinyInt1   
     Shift description.dbo.Name50   
     Shift start time.1450   
     Shift end time.1450   
     Date and time the record was last updated.DBTimeStamp4 
    (getdate())
     
    Indexes
    IndexDescriptionPrimaryUnique
    Unique nonclustered index. 
    Unique nonclustered index. 
    Primary key (clustered) constraint
    Relationships
    RelationshipDescription
    Foreign key constraint referencing Shift.ShiftID
    Objects that depend on HumanResources.Shift
     Database ObjectObject TypeDescriptionDep Level
    HumanResources.EmployeeDepartmentHistory tableHumanResources.EmployeeDepartmentHistoryTableEmployee department transfers.2
    HumanResources.vEmployeeDepartment viewHumanResources.vEmployeeDepartmentViewReturns employee name, title, and current department.1
    HumanResources.vEmployeeDepartmentHistory viewHumanResources.vEmployeeDepartmentHistoryViewReturns employee name and current and previous departments.1
    Objects that HumanResources.Shift depends on
     Database ObjectObject TypeDescriptionDep Level
    dbo.Name datatypedbo.NameUser Defined Data Type 2
    SQL
    SET ANSI_NULLS ON
    SET QUOTED_IDENTIFIER ON
    CREATE TABLE [HumanResources].[Shift](
        [ShiftID] [tinyint] IDENTITY(1,1) NOT NULL,
        [Name] [dbo].[Name] NOT NULL,
        [StartTime] [time](7) NOT NULL,
        [EndTime] [time](7) 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]
    See Also