IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[order_169_5]') AND type = 'U')
CREATE TABLE [dbo].[order_169_5]
(
    [ord2_caption] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_code] varchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_date] datetime NULL DEFAULT(getdate()),
    [ord2_dfje] decimal(18, 2) NULL DEFAULT((0)),
    [ord2_fatherord2id] bigint NULL DEFAULT((0)),
    [ord2_fbizid] int NULL DEFAULT((0)),
    [ord2_ford2id] bigint NULL DEFAULT((0)),
    [ord2_ford2tag] int NULL DEFAULT((0)),
    [ord2_fordid] bigint NULL DEFAULT((0)),
    [ord2_ftype] varchar(10) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_group] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_id] bigint NOT NULL IDENTITY(1, 1),
    [ord2_jfje] decimal(18, 2) NULL DEFAULT((0)),
    [ord2_key] varchar(30) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_kmdm] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_kmmc] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_order] int NULL DEFAULT((999)),
    [ord2_ordid] bigint NULL DEFAULT((0)),
    [ord2_rbizid] int NULL DEFAULT((0)),
    [ord2_rord2id] bigint NULL DEFAULT((0)),
    [ord2_rord2tag] int NULL DEFAULT((0)),
    [ord2_rordid] bigint NULL DEFAULT((0)),
    [ord2_rtype] varchar(10) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_sm] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_status] nvarchar(30) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_tag] int NULL DEFAULT((0)),
    [ord2_tags] varchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_updated] datetime NULL DEFAULT(getdate()),
    CONSTRAINT [order_169_5_pk] PRIMARY KEY ([ord2_id] ASC)
)


IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE object_id = OBJECT_ID('[dbo].[order_169_5]') AND name = 'order_169_5_index_1')
CREATE NONCLUSTERED INDEX [order_169_5_index_1] ON [dbo].[order_169_5]([ord2_ordid] ASC,[ord2_tag] ASC,[ord2_group] ASC)