IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_biztype]') AND type = 'U')
CREATE TABLE [dbo].[mps_biztype]
(
    [biz_id] int NOT NULL IDENTITY(1, 1),
    [biz_cmpid] int NULL DEFAULT((0)),
    [biz_formstyle] int NULL DEFAULT((1)),
    [biz_category] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [biz_subcategory] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [biz_title] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [biz_order] varchar(20) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [biz_status] int NULL DEFAULT((1)),
    [biz_code] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [biz_icon0] varchar(200) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [biz_icon] varchar(200) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [biz_database] varchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [biz_table] int NULL DEFAULT((0)),
    [biz_sourcebizids] nvarchar(4000) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [biz_groupfields] varchar(200) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [biz_querytime] int NULL DEFAULT((0)),
    [biz_hidemenu] int NULL DEFAULT((1)),
    [biz_onlysourcecreate] int NULL DEFAULT((1)),
    [biz_nomanualcreate] int NULL DEFAULT((1)),
    [biz_createinfather] int NULL DEFAULT((0)),
    [biz_funcs] varchar(200) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [biz_flows] nvarchar(2000) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [biz_params] varchar(500) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [biz_searchfields] varchar(2000) COLLATE Chinese_PRC_CI_AS NULL,
    [biz_selectstyle] int NULL DEFAULT((0)),
    [biz_selectfuncs] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL,
    [biz_security] int NULL DEFAULT((0)),
    [biz_viewscope] int NULL DEFAULT((0)),
    [biz_views] int NULL DEFAULT((0)),
    [biz_changed] int NULL,
    [biz_select] nvarchar(4000) COLLATE Chinese_PRC_CI_AS NULL,
    [biz_from] nvarchar(2000) COLLATE Chinese_PRC_CI_AS NULL,
    [biz_where] nvarchar(4000) COLLATE Chinese_PRC_CI_AS NULL,
    [biz_orderby] nvarchar(2000) COLLATE Chinese_PRC_CI_AS NULL,
    [biz_hidemenu_mobile] int NULL DEFAULT((1)),
    [biz_url] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [biz_auto_webservice] varchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [biz_auto2_interval] int NULL DEFAULT((0)),
    [biz_auto2_unit] varchar(10) COLLATE Chinese_PRC_CI_AS NULL DEFAULT((0)),
    [biz_auto2_starttime] datetime NULL DEFAULT('1900-01-01'),
    [biz_auto2_webservice] varchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    CONSTRAINT [PK_MPS_BIZTYPE] PRIMARY KEY ([biz_id] ASC)
)


IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE object_id = OBJECT_ID('[dbo].[mps_biztype]') AND name = 'mps_biztype_main_index')
CREATE NONCLUSTERED INDEX [mps_biztype_main_index] ON [dbo].[mps_biztype]([biz_cmpid] ASC,[biz_category] ASC,[biz_subcategory] ASC,[biz_order] ASC)