Tables [dbo].[PlasticDeal]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
Row Count (~)0
Created4:09:40 PM Thursday, December 6, 2018
Last Modified9:05:04 AM Friday, November 22, 2024
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentityDefault
Cluster Primary Key PK_PlasticDeal: DealIDDealIDint4
No
1 - 1
Foreign Keys FK_PlasticDeal_Instrument: [dbo].[PlasticInstrument].InstrumentFIDIndexes IX_PlasticDeal_Instrument: InstrumentFIDInstrumentFIDint4
No
Check Constraints CK_PlasticDeal_DealType : ([DealType]='V' OR [DealType]='T' OR [DealType]='S' OR [DealType]='R' OR [DealType]='A')DealTypechar(1)1
No
Descriptionvarchar(255)255
No
Indexes IX_PlasticDeal_TransactionCode: TransactionCodeTransactionCodevarchar(50)50
Yes
ApprovalCodevarchar(100)100
Yes
ProcessorCodevarchar(100)100
Yes
BillingCyclebigint8
Yes
OriginalAmountmoney8
No
ApprovedAmountmoney8
No
Foreign Keys FK_PlasticDeal_OriginFID: [dbo].[PlasticOrigin].OriginFIDOriginFIDint4
No
Foreign Keys FK_PlasticDeal_StatementDetailFID: [dbo].[StatementDetail].StatementDetailFIDIndexes IX_PlasticDeal_StatementDetailFID: StatementDetailFIDStatementDetailFIDint4
Yes
TransactionDatedatetime8
Yes
ResponseCodevarchar(20)20
Yes
ResponseMessagevarchar(255)255
Yes
CscResponseCodevarchar(1)1
Yes
TransactionStatusvarchar(15)15
Yes
Foreign Keys FK_PlasticDeal_SysUserFID: [dbo].[Sysuser].SysUserFIDIndexes IX_PlasticDeal_SysUserFID: SysUserFIDSysUserFIDint4
No
ActivityDatedatetime8
No
(getutcdate())
Foreign Keys FK_PlasticDeal_StorageInvoiceFID: [dbo].[StorageInvoice].StorageInvoiceFIDIndexes IX_PlasticDeal_StorageInvoiceFID: StorageInvoiceFIDStorageInvoiceFIDint4
Yes
Foreign Keys FK_PlasticDeal_BatchStatusFID: [dbo].[PlasticBatchStatus].BatchStatusFIDBatchStatusFIDint4
Yes
Foreign Keys FK_PlasticDeal_BatchErrorCodeFID: [dbo].[ErrorCode].BatchErrorCodeFIDBatchErrorCodeFIDint4
Yes
WasReprocessedbit1
Yes
Foreign Keys FK_PlasticDeal_WebDealFID: [dbo].[PlasticWebDeal].WebDealFIDWebDealFIDint4
Yes
Indexes IX_PlasticDeal_WebTransactionCode: WebTransactionCodeWebTransactionCodevarchar(50)50
Yes
Indexes IX_PlasticDeal_TransactionID: TransactionIDTransactionIDvarchar(40)40
Yes
PurchaseOrderNovarchar(50)50
Yes
HppSessionIDvarchar(50)50
Yes
MssTransactionIDvarchar(40)40
Yes
CurrencyCodevarchar(3)3
Yes
AuthorizationDatedatetime8
Yes
Foreign Keys FK_PlasticDeal_AuthorizationByFID: [dbo].[Sysuser].AuthorizationByFIDIndexes IX_PlasticDeal_AuthorizationByFID: AuthorizationByFIDAuthorizationByFIDint4
Yes
AuthorizationAmountmoney8
Yes
AuthorizationTransIdvarchar(50)50
Yes
AuthorizationMssTransIDvarchar(40)40
Yes
Foreign Keys FK_PlasticDeal_OrderFID: [dbo].[Orders].OrderFIDOrderFIDint4
Yes
CustomerNumbervarchar(15)15
Yes
Foreign Keys FK_PlasticDeal_BranchFID: [dbo].[Branch].BranchFIDBranchFIDint4
Yes
FinalizedDatedatetime8
Yes
Foreign Keys FK_PlasticDeal_FinalizedByFID: [dbo].[Sysuser].FinalizedByFIDIndexes IX_PlasticDeal_FinalizedByFID: FinalizedByFIDFinalizedByFIDint4
Yes
Indexes Indexes
NameColumnsUnique
Cluster Primary Key PK_PlasticDeal: DealIDPK_PlasticDealDealID
Yes
IX_PlasticDeal_AuthorizationByFIDAuthorizationByFID
IX_PlasticDeal_FinalizedByFIDFinalizedByFID
IX_PlasticDeal_InstrumentInstrumentFID
IX_PlasticDeal_StatementDetailFIDStatementDetailFID
IX_PlasticDeal_StorageInvoiceFIDStorageInvoiceFID
IX_PlasticDeal_SysUserFIDSysUserFID
IX_PlasticDeal_TransactionCodeTransactionCode
IX_PlasticDeal_TransactionIDTransactionID
IX_PlasticDeal_WebTransactionCodeWebTransactionCode
Check Constraints Check Constraints
NameOn ColumnConstraint
CK_PlasticDeal_DealTypeDealType([DealType]='V' OR [DealType]='T' OR [DealType]='S' OR [DealType]='R' OR [DealType]='A')
Foreign Keys Foreign Keys
NameColumns
FK_PlasticDeal_AuthorizationByFIDAuthorizationByFID->[dbo].[Sysuser].[SysUserID]
FK_PlasticDeal_BatchErrorCodeFIDBatchErrorCodeFID->[dbo].[ErrorCode].[ECPriKey]
FK_PlasticDeal_BatchStatusFIDBatchStatusFID->[dbo].[PlasticBatchStatus].[BatchStatusID]
FK_PlasticDeal_BranchFIDBranchFID->[dbo].[Branch].[BranchPriKey]
FK_PlasticDeal_FinalizedByFIDFinalizedByFID->[dbo].[Sysuser].[SysUserID]
FK_PlasticDeal_InstrumentInstrumentFID->[dbo].[PlasticInstrument].[InstrumentID]
FK_PlasticDeal_OrderFIDOrderFID->[dbo].[Orders].[PriKey]
FK_PlasticDeal_OriginFIDOriginFID->[dbo].[PlasticOrigin].[OriginID]
FK_PlasticDeal_StatementDetailFIDStatementDetailFID->[dbo].[StatementDetail].[SDPriKey]
FK_PlasticDeal_StorageInvoiceFIDStorageInvoiceFID->[dbo].[StorageInvoice].[StorageInvoicePriKey]
FK_PlasticDeal_SysUserFIDSysUserFID->[dbo].[Sysuser].[SysUserID]
FK_PlasticDeal_WebDealFIDWebDealFID->[dbo].[PlasticWebDeal].[WebDealID]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[PlasticDeal]
(
[DealID] [int] NOT NULL IDENTITY(1, 1),
[InstrumentFID] [int] NOT NULL,
[DealType] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Description] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[TransactionCode] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ApprovalCode] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ProcessorCode] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[BillingCycle] [bigint] NULL,
[OriginalAmount] [money] NOT NULL,
[ApprovedAmount] [money] NOT NULL,
[OriginFID] [int] NOT NULL,
[StatementDetailFID] [int] NULL,
[TransactionDate] [datetime] NULL,
[ResponseCode] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ResponseMessage] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CscResponseCode] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[TransactionStatus] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[SysUserFID] [int] NOT NULL,
[ActivityDate] [datetime] NOT NULL CONSTRAINT [DF_PlasticDeal_ActivityDate] DEFAULT (getutcdate()),
[StorageInvoiceFID] [int] NULL,
[BatchStatusFID] [int] NULL,
[BatchErrorCodeFID] [int] NULL,
[WasReprocessed] [bit] NULL,
[WebDealFID] [int] NULL,
[WebTransactionCode] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[TransactionID] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[PurchaseOrderNo] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[HppSessionID] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[MssTransactionID] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CurrencyCode] [varchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[AuthorizationDate] [datetime] NULL,
[AuthorizationByFID] [int] NULL,
[AuthorizationAmount] [money] NULL,
[AuthorizationTransId] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[AuthorizationMssTransID] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[OrderFID] [int] NULL,
[CustomerNumber] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[BranchFID] [int] NULL,
[FinalizedDate] [datetime] NULL,
[FinalizedByFID] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[PlasticDeal] ADD CONSTRAINT [CK_PlasticDeal_DealType] CHECK (([DealType]='V' OR [DealType]='T' OR [DealType]='S' OR [DealType]='R' OR [DealType]='A'))
GO
ALTER TABLE [dbo].[PlasticDeal] ADD CONSTRAINT [PK_PlasticDeal] PRIMARY KEY CLUSTERED  ([DealID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_PlasticDeal_AuthorizationByFID] ON [dbo].[PlasticDeal] ([AuthorizationByFID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_PlasticDeal_FinalizedByFID] ON [dbo].[PlasticDeal] ([FinalizedByFID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_PlasticDeal_Instrument] ON [dbo].[PlasticDeal] ([InstrumentFID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_PlasticDeal_StatementDetailFID] ON [dbo].[PlasticDeal] ([StatementDetailFID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_PlasticDeal_StorageInvoiceFID] ON [dbo].[PlasticDeal] ([StorageInvoiceFID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_PlasticDeal_SysUserFID] ON [dbo].[PlasticDeal] ([SysUserFID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_PlasticDeal_TransactionCode] ON [dbo].[PlasticDeal] ([TransactionCode]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_PlasticDeal_TransactionID] ON [dbo].[PlasticDeal] ([TransactionID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_PlasticDeal_WebTransactionCode] ON [dbo].[PlasticDeal] ([WebTransactionCode]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[PlasticDeal] ADD CONSTRAINT [FK_PlasticDeal_AuthorizationByFID] FOREIGN KEY ([AuthorizationByFID]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
ALTER TABLE [dbo].[PlasticDeal] ADD CONSTRAINT [FK_PlasticDeal_BatchErrorCodeFID] FOREIGN KEY ([BatchErrorCodeFID]) REFERENCES [dbo].[ErrorCode] ([ECPriKey])
GO
ALTER TABLE [dbo].[PlasticDeal] ADD CONSTRAINT [FK_PlasticDeal_BatchStatusFID] FOREIGN KEY ([BatchStatusFID]) REFERENCES [dbo].[PlasticBatchStatus] ([BatchStatusID])
GO
ALTER TABLE [dbo].[PlasticDeal] ADD CONSTRAINT [FK_PlasticDeal_BranchFID] FOREIGN KEY ([BranchFID]) REFERENCES [dbo].[Branch] ([BranchPriKey])
GO
ALTER TABLE [dbo].[PlasticDeal] ADD CONSTRAINT [FK_PlasticDeal_FinalizedByFID] FOREIGN KEY ([FinalizedByFID]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
ALTER TABLE [dbo].[PlasticDeal] ADD CONSTRAINT [FK_PlasticDeal_Instrument] FOREIGN KEY ([InstrumentFID]) REFERENCES [dbo].[PlasticInstrument] ([InstrumentID])
GO
ALTER TABLE [dbo].[PlasticDeal] ADD CONSTRAINT [FK_PlasticDeal_OrderFID] FOREIGN KEY ([OrderFID]) REFERENCES [dbo].[Orders] ([PriKey])
GO
ALTER TABLE [dbo].[PlasticDeal] ADD CONSTRAINT [FK_PlasticDeal_OriginFID] FOREIGN KEY ([OriginFID]) REFERENCES [dbo].[PlasticOrigin] ([OriginID])
GO
ALTER TABLE [dbo].[PlasticDeal] ADD CONSTRAINT [FK_PlasticDeal_StatementDetailFID] FOREIGN KEY ([StatementDetailFID]) REFERENCES [dbo].[StatementDetail] ([SDPriKey])
GO
ALTER TABLE [dbo].[PlasticDeal] ADD CONSTRAINT [FK_PlasticDeal_StorageInvoiceFID] FOREIGN KEY ([StorageInvoiceFID]) REFERENCES [dbo].[StorageInvoice] ([StorageInvoicePriKey])
GO
ALTER TABLE [dbo].[PlasticDeal] ADD CONSTRAINT [FK_PlasticDeal_SysUserFID] FOREIGN KEY ([SysUserFID]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
ALTER TABLE [dbo].[PlasticDeal] ADD CONSTRAINT [FK_PlasticDeal_WebDealFID] FOREIGN KEY ([WebDealFID]) REFERENCES [dbo].[PlasticWebDeal] ([WebDealID])
GO
GRANT SELECT ON  [dbo].[PlasticDeal] TO [MssExec]
GRANT INSERT ON  [dbo].[PlasticDeal] TO [MssExec]
GRANT DELETE ON  [dbo].[PlasticDeal] TO [MssExec]
GRANT UPDATE ON  [dbo].[PlasticDeal] TO [MssExec]
GO
Uses
Used By