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.
Table properties
| name | value |
|---|
| name | [dbo].[ErrorLog] |
| created | Mar 19 2009 9:08PM |
| modified | Mar 19 2009 9:08PM
|
| ansi nulls | on
|
| quoted identifier | on
|
| row count | |
| Size of data | 0 kb |
| Size of indexes | 0 kb |
| Maximum size of a single row | 16,788 bytes |
Columns
| column | datatype | length | bytes | default | nulls | PK | FK | UQ | computed | comment |
|---|
| ErrorLogID | int identity(1,1) | 10 | 4 | | no
| yes
| |
| no
| Primary key for ErrorLog records.
|
| ErrorTime | datetime | 23 | 8 | (getdate()) | no
|
| |
| no
| The date and time at which the error occurred.
|
| UserName | sysname | 128 | 256 | | no
|
| |
| no
| The user who executed the batch in which the error occurred.
|
| ErrorNumber | int | 10 | 4 | | no
|
| |
| no
| The error number of the error that occurred.
|
| ErrorSeverity | int | 10 | 4 | | yes
|
| |
| no
| The severity of the error that occurred.
|
| ErrorState | int | 10 | 4 | | yes
|
| |
| no
| The state number of the error that occurred.
|
| ErrorProcedure | nvarchar(126) | 126 | 504 | | yes
|
| |
| no
| The name of the stored procedure or trigger where the error occurred.
|
| ErrorLine | int | 10 | 4 | | yes
|
| |
| no
| The line number at which the error occurred.
|
| ErrorMessage | nvarchar(4000) | 4000 | 16000 | | no
|
| |
| no
| The message text of the error that occurred.
|
Indexes
| name | description | column | comment |
|---|
| PK_ErrorLog_ErrorLogID | clustered, unique, primary key located on PRIMARY | ErrorLogID | Clustered index created by a primary key constraint.
|
Defaults
Dependency graph
Objects that depend on [dbo].[ErrorLog]
Code
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,
CONSTRAINT [PK_ErrorLog_ErrorLogID] PRIMARY KEY CLUSTERED
(
[ErrorLogID] 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 [dbo].[ErrorLog] ADD CONSTRAINT [DF_ErrorLog_ErrorTime] DEFAULT (getdate()) FOR [ErrorTime]