IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[doc_1]') AND type = 'U')
CREATE TABLE [dbo].[doc_1]
(
    [doc_id] bigint NOT NULL IDENTITY(1, 1),
    [doc_cmpid] int NULL DEFAULT((0)),
    [doc_dcid] int NULL DEFAULT((0)),
    [doc_code] varchar(30) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [doc_title] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [doc_date] datetime NULL DEFAULT(getdate()),
    [doc_bcid] int NULL DEFAULT((0)),
    [doc_dpid] int NULL DEFAULT((0)),
    [doc_cuid] int NULL DEFAULT((0)),
    [doc_security] int NULL DEFAULT((0)),
    [doc_branch] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [doc_depart] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [doc_creator] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [doc_update] datetime NULL DEFAULT(getdate()),
    [doc_click] int NULL DEFAULT((0)),
    [doc_expired] datetime NULL DEFAULT('1900-1-1'),
    [doc_image] varchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [doc_abstract] nvarchar(4000) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [doc_labels] nvarchar(4000) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    CONSTRAINT [PK_doc_1] PRIMARY KEY ([doc_id] ASC)
)


IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE object_id = OBJECT_ID('[dbo].[doc_1]') AND name = 'ida_xxxxxxx')
CREATE NONCLUSTERED INDEX [ida_xxxxxxx] ON [dbo].[doc_1]([doc_bcid] ASC,[doc_click] ASC,[doc_depart] ASC)

IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE object_id = OBJECT_ID('[dbo].[doc_1]') AND name = 'ida_yyyyy')
CREATE NONCLUSTERED INDEX [ida_yyyyy] ON [dbo].[doc_1]([doc_dpid] ASC,[doc_id] ASC,[doc_bcid] ASC)