IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[order_243_authority_control]') AND type = 'U')
CREATE TABLE [dbo].[order_243_authority_control]
(
    [orda_auto] smallint NULL DEFAULT((0)),
    [orda_cuid] int NULL DEFAULT((0)),
    [orda_ordafid] int NULL DEFAULT((0)),
    [orda_type] int NULL DEFAULT((0)),
)

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

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

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

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