CREATE TABLE [dbo].[SOOrderChargeTransactions]
(
[SOOrderChargeTransactionID] [int] NOT NULL IDENTITY(1, 1),
[SOID] [int] NOT NULL,
[ChargeAccountTransactionID] [int] NOT NULL,
[CreateDate] [datetime] NOT NULL CONSTRAINT [DF_SOOrderChargeTransactions_CreateDate] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SOOrderChargeTransactions] ADD CONSTRAINT [PK_SOOrderChargeTransactions] PRIMARY KEY CLUSTERED ([SOOrderChargeTransactionID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SOOrderChargeTransactions] ADD CONSTRAINT [FK_SOOrderChargeTransactions_ChargeAccountTransactionID_ARChargeAccountTransactions] FOREIGN KEY ([ChargeAccountTransactionID]) REFERENCES [dbo].[ARChargeAccountTransactions] ([ChargeAccountTransactionID])
GO
ALTER TABLE [dbo].[SOOrderChargeTransactions] ADD CONSTRAINT [FK_SOOrderChargeTransactions_SOID_SOOrders] FOREIGN KEY ([SOID]) REFERENCES [dbo].[SOOrders] ([SOID])
GO