IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[sys_sql_err]') AND type = 'U')
CREATE TABLE [dbo].[sys_sql_err]
(
    [errid] int NOT NULL IDENTITY(1, 1),
    [cmpid] int NULL,
    [parseid] int NULL,
    [errmsg] varchar(4000) COLLATE Chinese_PRC_CI_AS NULL,
    [errlevel] int NULL,
    [tm] smalldatetime NULL,
    CONSTRAINT [PK_SYS_SQL_ERR] PRIMARY KEY ([errid] ASC)
)