Table:
[AdventureWorks2016CTP3].[HumanResources].[Department]
Table properties
| Name | Value |
| Schema | [HumanResources] |
| Owner | [dbo] |
| Table is replicated | |
| Creation date | 23.10.2015 |
| ID | 1365579903 |
| Located on | PRIMARY |
| Data size KB | 8 KB |
| Index size KB | 24 KB |
| Rows | 16 |
| ChangeTrackingEnabled | |
| FileStreamFileGroup | |
| FileStreamPartitionScheme | |
| LockEscalation | TABLE |
| TrackColumnsUpdatedEnabled | |
| Table is filetable | |
| Filetable directory | |
| Filetable collate | |
| Filetable primary key | [PK_Department_DepartmentID] |
| Filetable streamid unique | |
| Filetable fullpath unique | |
| Filetable is enabled | |
| Is memory optimized | |
| Durability | SCHEMA_AND_DATA |
Creation options
| Name | Value |
| QUOTED_IDENTIFIER | ON |
| ANSI_NULLS | ON |
| ANSI_PADDING | ON |
Columns
| Name | Description | Data type | Max length | Nullable | Default | IsGUID | SPARSE | Computed value | |||
| | DepartmentID | smallint | 2 | |||||||
| Name | [dbo].[Name] | 50 | |||||||||
| GroupName | [dbo].[Name] | 50 | |||||||||
| ModifiedDate | datetime | 8 | (getdate()) |
Indexes
| Index | Description | Primary | Unique | Size KB | ||
| [PK_Department_DepartmentID] | DepartmentID | ![]() |
![]() |
32 | 0 | |
| [AK_Department_Name] | Name | ![]() |
16 | 0 |
Columnstore indexes
Identity column
| Name | Seed | Increment | Not for replication | |
![]() |
DepartmentID | 1 | 1 |
Referencing tables
| Table | Foreign key | Primary key or unique constraint |
| [HumanResources].[EmployeeDepartmentHistory] | FK_EmployeeDepartmentHistory_Department_DepartmentID | PK_Department_DepartmentID |
Triggers
| Name | Schema | Description | Instead of |
For insert |
For update |
For delete |
Table/view |
| [HumanResources].[tr_i_AUDIT_Department] | [HumanResources] | ![]() |
[HumanResources].[Department] | ||||
| [HumanResources].[tr_u_AUDIT_Department] | [HumanResources] | ![]() |
[HumanResources].[Department] | ||||
| [HumanResources].[tr_d_AUDIT_Department] | [HumanResources] | ![]() |
[HumanResources].[Department] |
Objects that depend on [HumanResources].[Department]
| Object name | Object type | Dep level |
| [HumanResources].[EmployeeDepartmentHistory] | Table | 1 |
| [HumanResources].[tr_d_AUDIT_Department] | Trigger | 1 |
| [HumanResources].[tr_i_AUDIT_Department] | Trigger | 1 |
| [HumanResources].[tr_u_AUDIT_Department] | Trigger | 1 |
| [HumanResources].[vEmployeeDepartment] | View | 1 |
| [HumanResources].[vEmployeeDepartmentHistory] | View | 1 |
Objects that [HumanResources].[Department] depends on
| Object name | Object type | Dep level |
| [HumanResources] | Schema | 1 |
| [dbo].[Name] | Datatype | 1 |
Extended properties
| Name | Value |
| MS_Description | Lookup table containing the departments within the Adventure Works Cycles company. |
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 |
SQL
SET ANSI_NULLS ON SET QUOTED_IDENTIFIER ON SET ANSI_PADDING ON GO 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]) ON [PRIMARY] ) ON [PRIMARY] GO EXEC sp_addextendedproperty N'MS_Description', N'Primary key (clustered) constraint', 'SCHEMA', N'HumanResources', 'TABLE', N'Department', 'CONSTRAINT', N'PK_Department_DepartmentID' GO EXEC sp_addextendedproperty N'MS_Description', N'Clustered index created by a primary key constraint.', 'SCHEMA', N'HumanResources', 'TABLE', N'Department', 'INDEX', N'PK_Department_DepartmentID' GO ALTER TABLE [HumanResources].[Department] ADD CONSTRAINT [DF_Department_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate] GO EXEC sp_addextendedproperty N'MS_Description', N'Default constraint value of GETDATE()', 'SCHEMA', N'HumanResources', 'TABLE', N'Department', 'CONSTRAINT', N'DF_Department_ModifiedDate' GO CREATE UNIQUE NONCLUSTERED INDEX [AK_Department_Name] ON [HumanResources].[Department] ([Name]) ON [PRIMARY] GO EXEC sp_addextendedproperty N'MS_Description', N'Unique nonclustered index.', 'SCHEMA', N'HumanResources', 'TABLE', N'Department', 'INDEX', N'AK_Department_Name' GO EXEC sp_addextendedproperty N'MS_Description', N'Primary key for Department records.', 'SCHEMA', N'HumanResources', 'TABLE', N'Department', 'COLUMN', N'DepartmentID' GO EXEC sp_addextendedproperty N'MS_Description', N'Name of the group to which the department belongs.', 'SCHEMA', N'HumanResources', 'TABLE', N'Department', 'COLUMN', N'GroupName' GO EXEC sp_addextendedproperty N'MS_Description', N'Date and time the record was last updated.', 'SCHEMA', N'HumanResources', 'TABLE', N'Department', 'COLUMN', N'ModifiedDate' GO EXEC sp_addextendedproperty N'MS_Description', N'Name of the department.', 'SCHEMA', N'HumanResources', 'TABLE', N'Department', 'COLUMN', N'Name' GO EXEC sp_addextendedproperty N'MS_Description', N'Lookup table containing the departments within the Adventure Works Cycles company.', 'SCHEMA', N'HumanResources', 'TABLE', N'Department', NULL, NULL GO |
See also