# Table: ErrorLog

## Properties

Property | Value
--- | ---
Name | ErrorLog
ID | 2137058649
Owner | dbo
Schema | dbo
Filegroup | PRIMARY
Data Size (KB) | 0 KB
Index Size (KB) | 0 KB
Rows | 0
Unused (KB) | 0 KB
ANSI Null On |
Quoted Identifier |
Lock Escalation | TABLE
Lock On Bulk Load |
Lob Data Space |
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:21:43 PM
Create Date | 8/8/2010 5:21:43 PM

## Extended Properties

Name | Value
--- | ---
MS_Description | Audit table tracking errors in the the AdventureWorks database that are caught by the CATCH block of a TRY...CATCH construct. Data is inserted by stored procedure dbo.uspLogError when it is executed from inside the CATCH block of a TRY...CATCH construct.

## Columns

Column ID | Column Name | Datatype | Nullable | Is Sparse | Is Column Set
--- | --- | --- | --- | --- | ---
1 | ErrorLogID | int |  |  |
2 | ErrorTime | datetime |  |  |
3 | UserName | sysname |  |  |
4 | ErrorNumber | int |  |  |
5 | ErrorSeverity | int |  |  |
6 | ErrorState | int |  |  |
7 | ErrorProcedure | nvarchar(126) |  |  |
8 | ErrorLine | int |  |  |
9 | ErrorMessage | nvarchar(4000) |  |  |

## Identity Columns

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

## Primary Key Constraints

Name | Is System Named | Extended Property Name | Extended Property Value
--- | --- | --- | ---
PK_ErrorLog_ErrorLogID |  | MS_Description | Primary key (clustered) constraint

## Primary Key Columns

Name
ErrorLogID

## Foreign Keys

No foreign keys defined.

## Column Level Check Constraints

No column constraints defined.

## Table Level Check Constraints

No table constraints defined.

## Default Constraints

Name | Column | Definition | Is System Named | Extended Property Name | Extended Property Value
--- | --- | --- | --- | --- | ---
DF_ErrorLog_ErrorTime | ErrorTime | (getdate()) |  | MS_Description | Default constraint value of GETDATE()

## Indexes

Name | Index Type | Primary Key | Unique | Unique Constraint | Ignore Duplicate Key | Disabled
--- | --- | --- | --- | --- | --- | ---
PK_ErrorLog_ErrorLogID | CLUSTERED |  |  |  |  |

## 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_ErrorLog_ErrorLogID |  |  |  |  |  |  |  |  |

### Detailed Statistics Density

No detailed statistics.

### Detailed Statistics Histogram

No histogram statistics.

## Objects that depend on [ErrorLog]

- dbo.ErrorLog
  - dbo.uspLogError
    - HumanResources.uspUpdateEmployeeHireInfo
    - HumanResources.uspUpdateEmployeeLogin
    - HumanResources.uspUpdateEmployeePersonalInfo
    - Production.WorkOrder
      - Production.iWorkOrder
      - Production.uWorkOrder
      - Production.WorkOrderRouting
    - Purchasing.PurchaseOrderDetail
      - Purchasing.iPurchaseOrderDetail
      - Purchasing.uPurchaseOrderDetail
    - Purchasing.PurchaseOrderHeader
      - Purchasing.uPurchaseOrderHeader
    - Purchasing.Vendor
      - dbo.ufnGetContactInformation
      - Purchasing.dVendor
      - Purchasing.ProductVendor
      - Purchasing.vVendorWithAddresses
      - Purchasing.vVendorWithContacts
    - Sales.SalesOrderDetail
      - Sales.iduSalesOrderDetail
      - Sales.ufn_SalesByStore
    - Sales.SalesOrderHeader
      - Sales.SalesOrderHeaderSalesReason
      - Sales.uSalesOrderHeader
      - Sales.vSalesPersonSalesByFiscalYears

## Objects on which [ErrorLog] depends

- dbo.ErrorLog

## SQL

Script
SET ANSI_NULLS ON SET QUOTED_IDENTIFIER ON CREATE TABLE [dbo].[ErrorLog]( [ErrorLogID] [int] IDENTITY(1,1) NOT NULL, [ErrorTime] [datetime] NOT NULL, [UserName] [sysname] COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [ErrorNumber] [int] NOT NULL, [ErrorSeverity] [int] NULL, [ErrorState] [int] NULL, [ErrorProcedure] [nvarchar](126) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [ErrorLine] [int] NULL, [ErrorMessage] [nvarchar](4000) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ) ON [PRIMARY] EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Primary key for ErrorLog records.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ErrorLog', @level2type=N'COLUMN',@level2name=N'ErrorLogID' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The date and time at which the error occurred.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ErrorLog', @level2type=N'COLUMN',@level2name=N'ErrorTime' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The user who executed the batch in which the error occurred.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ErrorLog', @level2type=N'COLUMN',@level2name=N'UserName' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The error number of the error that occurred.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ErrorLog', @level2type=N'COLUMN',@level2name=N'ErrorNumber' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The severity of the error that occurred.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ErrorLog', @level2type=N'COLUMN',@level2name=N'ErrorSeverity' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The state number of the error that occurred.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ErrorLog', @level2type=N'COLUMN',@level2name=N'ErrorState' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The name of the stored procedure or trigger where the error occurred.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ErrorLog', @level2type=N'COLUMN',@level2name=N'ErrorProcedure' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The line number at which the error occurred.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ErrorLog', @level2type=N'COLUMN',@level2name=N'ErrorLine' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The message text of the error that occurred.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ErrorLog', @level2type=N'COLUMN',@level2name=N'ErrorMessage' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Audit table tracking errors in the the AdventureWorks database that are caught by the CATCH block of a TRY...CATCH construct. Data is inserted by stored procedure dbo.uspLogError when it is executed from inside the CATCH block of a TRY...CATCH construct.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ErrorLog'

#### See also

List of Tables