IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[order_241_2]') AND type = 'U')
CREATE TABLE [dbo].[order_241_2]
(
    [ord2_caption] nvarchar(100) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [ord2_code] varchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [ord2_date] datetime NOT NULL DEFAULT(getdate()),
    [ord2_fatherord2id] bigint NOT NULL DEFAULT((0)),
    [ord2_fbizid] int NOT NULL DEFAULT((0)),
    [ord2_ford2id] bigint NOT NULL DEFAULT((0)),
    [ord2_ford2tag] int NOT NULL DEFAULT((0)),
    [ord2_fordid] bigint NOT NULL DEFAULT((0)),
    [ord2_ftype] varchar(10) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [ord2_group] nvarchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [ord2_hm] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_id] bigint NOT NULL IDENTITY(1, 1),
    [ord2_key] varchar(30) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [ord2_order] int NOT NULL DEFAULT((999)),
    [ord2_ordid] bigint NOT NULL DEFAULT((0)),
    [ord2_rbizid] int NOT NULL DEFAULT((0)),
    [ord2_rord2id] bigint NOT NULL DEFAULT((0)),
    [ord2_rord2tag] int NOT NULL DEFAULT((0)),
    [ord2_rordid] bigint NOT NULL DEFAULT((0)),
    [ord2_rtype] varchar(10) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [ord2_status] nvarchar(30) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [ord2_tag] int NOT NULL DEFAULT((0)),
    [ord2_tags] varchar(100) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [ord2_updated] datetime NOT NULL DEFAULT(getdate()),
    [ord2_xm] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
    [ord2_zzftc] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_ext01] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_ext02] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_ext03] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_ext04] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_ext05] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_ext06] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_ext07] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_ext08] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_ext09] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_ext10] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_ext11] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_ext12] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_ext13] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_ext14] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_ext15] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_ext16] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_ext17] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_ext18] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_ext19] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_ext20] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_mdbh] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_sfbd] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_whordid] int NULL DEFAULT((0)),
    [ord2_whstatus] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord2_cuid] int NULL DEFAULT((0)),
    [ord2_creator] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    CONSTRAINT [order_241_2_pk] PRIMARY KEY ([ord2_id] ASC)
)

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

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

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

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

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

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