Tables [dbo].[Advance]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
Row Count (~)5111
Created5:00:46 PM Monday, April 21, 2008
Last Modified9:11:11 AM Friday, November 8, 2024
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentityDefault
Cluster Primary Key PK_Advance: PriKeyPriKeyint4
No
1 - 1
Foreign Keys FK_Advance_AdvanceToSysUserFID: [dbo].[Sysuser].AdvanceToSysUserFIDIndexes IX_Advance_AdvanceToSysUserFID: AdvanceToSysUserFIDAdvanceToSysUserFIDint4
No
Foreign Keys FK_Advance_Orders: [dbo].[Orders].OrderFIDOrderFIDint4
Yes
Foreign Keys FK_Advance_Trips: [dbo].[Trips].TripPriKeyTripPriKeyint4
Yes
AdvanceDatedatetime8
No
AdvanceAmtmoney8
No
Reasonvarchar(60)60
Yes
Foreign Keys FK_Advance_AuthBy: [dbo].[Sysuser].AuthByForeign Keys FK_Advance_Sysuser: [dbo].[Sysuser].AuthByIndexes IX_Advance_AuthBy: AuthByAuthByint4
No
ReferenceNumbervarchar(32)32
Yes
ManualBankingServiceSendFlagbit1
No
((0))
Foreign Keys FK_Advance_AdvanceBatch: [dbo].[AdvanceBatch].AdvanceBatchFIDAdvanceBatchFIDint4
Yes
OffHoldDatedatetime8
Yes
OffHoldByint4
Yes
OffHoldDescriptionvarchar(64)64
Yes
VendorIDvarchar(15)15
Yes
Indexes Indexes
NameColumnsUniqueFill Factor
Cluster Primary Key PK_Advance: PriKeyPK_AdvancePriKey
Yes
80
IX_Advance_AdvanceToSysUserFIDAdvanceToSysUserFID
IX_Advance_AuthByAuthBy
Foreign Keys Foreign Keys
NameColumns
FK_Advance_AdvanceBatchAdvanceBatchFID->[dbo].[AdvanceBatch].[AdvanceBatchID]
FK_Advance_AdvanceToSysUserFIDAdvanceToSysUserFID->[dbo].[Sysuser].[SysUserID]
FK_Advance_AuthByAuthBy->[dbo].[Sysuser].[SysUserID]
FK_Advance_SysuserAuthBy->[dbo].[Sysuser].[SysUserID]
FK_Advance_OrdersOrderFID->[dbo].[Orders].[PriKey]
FK_Advance_TripsTripPriKey->[dbo].[Trips].[PriKey]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[Advance]
(
[PriKey] [int] NOT NULL IDENTITY(1, 1),
[AdvanceToSysUserFID] [int] NOT NULL,
[OrderFID] [int] NULL,
[TripPriKey] [int] NULL,
[AdvanceDate] [datetime] NOT NULL,
[AdvanceAmt] [money] NOT NULL,
[Reason] [varchar] (60) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[AuthBy] [int] NOT NULL,
[ReferenceNumber] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ManualBankingServiceSendFlag] [bit] NOT NULL CONSTRAINT [DF_Advance_ManualBankingServiceSendFlag] DEFAULT ((0)),
[AdvanceBatchFID] [int] NULL,
[OffHoldDate] [datetime] NULL,
[OffHoldBy] [int] NULL,
[OffHoldDescription] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[VendorID] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Advance] ADD CONSTRAINT [PK_Advance] PRIMARY KEY CLUSTERED  ([PriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_Advance_AdvanceToSysUserFID] ON [dbo].[Advance] ([AdvanceToSysUserFID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_Advance_AuthBy] ON [dbo].[Advance] ([AuthBy]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Advance] ADD CONSTRAINT [FK_Advance_AdvanceBatch] FOREIGN KEY ([AdvanceBatchFID]) REFERENCES [dbo].[AdvanceBatch] ([AdvanceBatchID])
GO
ALTER TABLE [dbo].[Advance] ADD CONSTRAINT [FK_Advance_AdvanceToSysUserFID] FOREIGN KEY ([AdvanceToSysUserFID]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
ALTER TABLE [dbo].[Advance] ADD CONSTRAINT [FK_Advance_AuthBy] FOREIGN KEY ([AuthBy]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
ALTER TABLE [dbo].[Advance] ADD CONSTRAINT [FK_Advance_Sysuser] FOREIGN KEY ([AuthBy]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
ALTER TABLE [dbo].[Advance] ADD CONSTRAINT [FK_Advance_Orders] FOREIGN KEY ([OrderFID]) REFERENCES [dbo].[Orders] ([PriKey])
GO
ALTER TABLE [dbo].[Advance] ADD CONSTRAINT [FK_Advance_Trips] FOREIGN KEY ([TripPriKey]) REFERENCES [dbo].[Trips] ([PriKey])
GO
GRANT SELECT ON  [dbo].[Advance] TO [MssExec]
GRANT INSERT ON  [dbo].[Advance] TO [MssExec]
GRANT DELETE ON  [dbo].[Advance] TO [MssExec]
GRANT UPDATE ON  [dbo].[Advance] TO [MssExec]
GO
Uses
Used By