IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_biztype_query]') AND type = 'U')
CREATE TABLE [dbo].[mps_biztype_query]
(
    [bql_id] int NOT NULL IDENTITY(1, 1),
    [bql_bizid] int NULL DEFAULT((0)),
    [bql_caption] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [bql_sql] nvarchar(4000) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [bql_status] int NULL DEFAULT((0)),
    [bql_orderby] nvarchar(4000) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [bql_order] int NULL DEFAULT((0)),
    [bql_group] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [bql_icon] varchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [bql_cmpid] int NULL DEFAULT((0)),
    CONSTRAINT [PK_mps_biztype_query] PRIMARY KEY ([bql_id] ASC)
)

IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE object_id = OBJECT_ID('[dbo].[mps_biztype_query]') AND name = 'mps_biztype_query_index')
CREATE NONCLUSTERED INDEX [mps_biztype_query_index] ON [dbo].[mps_biztype_query]([bql_bizid] ASC)