# Table: DatabaseLog

## Properties

Property | Value
--- | ---
Name | DatabaseLog
ID | 2105058535
Owner | dbo
Schema | dbo
Filegroup | PRIMARY
Data Size (KB) | 6408 KB
Index Size (KB) | 48 KB
Rows | 1597
Unused (KB) | 128 KB
ANSI Null On |
Quoted Identifier |
Lock Escalation | TABLE
Lock On Bulk Load |
Lob Data Space | PRIMARY
Filestream Data Space ID |
Has Unchecked Assembly Data |
Text In Row Limit (bytes) | Option not set
Large Value Types Out Of Row |
FullText Change Tracking On |
Tracked By Cdc |
Published |
Schema Published |
Replicated |
Replication Filter |
Merge Published |
Sync Tran Subscribed |
MS Shipped |
Modify Date | 8/8/2010 5:22:50 PM
Create Date | 8/8/2010 5:21:42 PM

## Extended Properties

Name | Value
--- | ---
MS_Description | Audit table tracking all DDL changes made to the AdventureWorks database. Data is captured by the database trigger ddlDatabaseTriggerLog. update

## Columns

Column ID | Column Name | Datatype | Nullable | Is Sparse | Is Column Set
--- | --- | --- | --- | --- | ---
1 | DatabaseLogID | int |  |  |
2 | PostTime | datetime |  |  |
3 | DatabaseUser | sysname |  |  |
4 | Event | sysname |  |  |
5 | Schema | sysname |  |  |
6 | Object | sysname |  |  |
7 | TSQL | nvarchar(max) |  |  |
8 | XmlEvent | xml |  |  |

## Identity Columns

Column | Seed Value | Increment Value | Last Value | Is Not For Replication | Is Computed | Is Sparse | Is Column Set
--- | --- | --- | --- | --- | --- | --- | ---
DatabaseLogID | 1 | 1 | 1597 |  |  |  |

## Primary Key Constraints

Name | Is System Named | Extended Property Name | Extended Property Value
--- | --- | --- | ---
PK_DatabaseLog_DatabaseLogID |  | MS_Description | Primary key (nonclustered) constraint

## Primary Key Columns

Name
DatabaseLogID

## Foreign Keys

No foreign keys defined.

## Column Level Check Constraints

No column constraints defined.

## Table Level Check Constraints

No table constraints defined.

## Default Constraints

No default constraints defined.

## Indexes

Name | Index Type | Primary Key | Unique | Unique Constraint | Ignore Duplicate Key | Disabled
--- | --- | --- | --- | --- | --- | ---
PK_DatabaseLog_DatabaseLogID | NONCLUSTERED |  |  |  |  |

## FullText Indexes

No fulltext indexes defined.

## Referencing Tables

No referencing tables defined.

## Object Level Permissions

No object level permissions defined.

## Column Level Permissions

No explicit column permissions granted to this object

## Statistics

### Detailed Statistics General

Name | Updated | Rows | Rows Sampled | Steps | Density | Average Key Length | String Index | Filter Expression | Unfiltered Rows
--- | --- | --- | --- | --- | --- | --- | --- | --- | ---
PK_DatabaseLog_DatabaseLogID | Aug 8 2010 5:22PM | 109 | 109 | 55 | 1 | 4 |  |  | 109

### Detailed Statistics Density

All Density | Average Length | Columns
--- | --- | ---
0.009174312 | 4 | DatabaseLogID

### Detailed Statistics Histogram

Range High Key | Range Rows | Estimated Rows | Distinct Range Rows | Avg Range Rows
--- | --- | --- | --- | ---
1 | 0 | 1 | 0 | 1
3 | 1 | 1 | 1 | 1
5 | 1 | 1 | 1 | 1
7 | 1 | 1 | 1 | 1
9 | 1 | 1 | 1 | 1
11 | 1 | 1 | 1 | 1
13 | 1 | 1 | 1 | 1
15 | 1 | 1 | 1 | 1
17 | 1 | 1 | 1 | 1
19 | 1 | 1 | 1 | 1
21 | 1 | 1 | 1 | 1
23 | 1 | 1 | 1 | 1
25 | 1 | 1 | 1 | 1
27 | 1 | 1 | 1 | 1
29 | 1 | 1 | 1 | 1
31 | 1 | 1 | 1 | 1
33 | 1 | 1 | 1 | 1
35 | 1 | 1 | 1 | 1
37 | 1 | 1 | 1 | 1
39 | 1 | 1 | 1 | 1
41 | 1 | 1 | 1 | 1
43 | 1 | 1 | 1 | 1
45 | 1 | 1 | 1 | 1
47 | 1 | 1 | 1 | 1
49 | 1 | 1 | 1 | 1
51 | 1 | 1 | 1 | 1
53 | 1 | 1 | 1 | 1
55 | 1 | 1 | 1 | 1
57 | 1 | 1 | 1 | 1
59 | 1 | 1 | 1 | 1
61 | 1 | 1 | 1 | 1
63 | 1 | 1 | 1 | 1
65 | 1 | 1 | 1 | 1
67 | 1 | 1 | 1 | 1
69 | 1 | 1 | 1 | 1
71 | 1 | 1 | 1 | 1
73 | 1 | 1 | 1 | 1
75 | 1 | 1 | 1 | 1
77 | 1 | 1 | 1 | 1
79 | 1 | 1 | 1 | 1
81 | 1 | 1 | 1 | 1
83 | 1 | 1 | 1 | 1
85 | 1 | 1 | 1 | 1
87 | 1 | 1 | 1 | 1
89 | 1 | 1 | 1 | 1
91 | 1 | 1 | 1 | 1
93 | 1 | 1 | 1 | 1
95 | 1 | 1 | 1 | 1
97 | 1 | 1 | 1 | 1
99 | 1 | 1 | 1 | 1
101 | 1 | 1 | 1 | 1
103 | 1 | 1 | 1 | 1
105 | 1 | 1 | 1 | 1
107 | 1 | 1 | 1 | 1
109 | 1 | 1 | 1 | 1

## Objects that depend on [DatabaseLog]

- dbo.DatabaseLog
  - ddlDatabaseTriggerLog

## Objects on which [DatabaseLog] depends

- dbo.DatabaseLog

## SQL

Script
SET ANSI_NULLS ON SET QUOTED_IDENTIFIER ON CREATE TABLE [dbo].[DatabaseLog]( [DatabaseLogID] [int] IDENTITY(1,1) NOT NULL, [PostTime] [datetime] NOT NULL, [DatabaseUser] [sysname] COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [Event] [sysname] COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [Schema] [sysname] COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [Object] [sysname] COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [TSQL] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [XmlEvent] [xml] NOT NULL ) ON [PRIMARY] EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Primary key for DatabaseLog records.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DatabaseLog', @level2type=N'COLUMN',@level2name=N'DatabaseLogID' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The date and time the DDL change occurred.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DatabaseLog', @level2type=N'COLUMN',@level2name=N'PostTime' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The user who implemented the DDL change.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DatabaseLog', @level2type=N'COLUMN',@level2name=N'DatabaseUser' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The type of DDL statement that was executed.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DatabaseLog', @level2type=N'COLUMN',@level2name=N'Event' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The schema to which the changed object belongs.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DatabaseLog', @level2type=N'COLUMN',@level2name=N'Schema' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The object that was changed by the DDL statment.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DatabaseLog', @level2type=N'COLUMN',@level2name=N'Object' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The exact Transact-SQL statement that was executed.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DatabaseLog', @level2type=N'COLUMN',@level2name=N'TSQL' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The raw XML data generated by database trigger.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DatabaseLog', @level2type=N'COLUMN',@level2name=N'XmlEvent' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Audit table tracking all DDL changes made to the AdventureWorks database. Data is captured by the database trigger ddlDatabaseTriggerLog. update' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DatabaseLog'

#### See also

List of Tables