Northwind Database (Document! X Sample)
HumanResources.Department Table
AdventureWorks Database > HumanResources Schema : HumanResources.Department Table
Description
Lookup table containing the departments within the Adventure Works Cycles company.
Properties
Creation Date27/10/2017 14:33
File GroupPRIMARY
Text File Group
System Object
Published for Replication
Rows16
Data Space Used8.00 KB
Index Space Used24.00 KB
Columns
 Column NameDescriptionDatatypeLengthAllow NullsDefaultFormula
Primary Key Primary key for Department records.SmallInt2   
 Name of the department.dbo.Name50   
 Name of the group to which the department belongs.dbo.Name50   
 Date and time the record was last updated.DBTimeStamp4 
(getdate())
 
Indexes
IndexDescriptionPrimaryUnique
Unique nonclustered index. 
Primary key (clustered) constraint
Relationships
RelationshipDescription
Foreign key constraint referencing Department.DepartmentID.
Objects that depend on HumanResources.Department
 Database ObjectObject TypeDescriptionDep Level
HumanResources.EmployeeDepartmentHistory tableHumanResources.EmployeeDepartmentHistoryTableEmployee department transfers.1
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.Department depends on
 Database ObjectObject TypeDescriptionDep Level
dbo.Name datatypedbo.NameUser Defined Data Type 1
SQL
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE TABLE [HumanResources].[Department](
    [DepartmentID] [smallint] IDENTITY(1,1) NOT NULL,
    [Name] [dbo].[Name] NOT NULL,
    [GroupName] [dbo].[Name] NOT NULL,
    [ModifiedDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Department_DepartmentID] PRIMARY KEY CLUSTERED 
(
    [DepartmentID] 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].[Department] ADD  CONSTRAINT [DF_Department_ModifiedDate]  DEFAULT (getdate()) FOR [ModifiedDate]
See Also

Related Objects

HumanResources Schema
AdventureWorks Database