Tables [dbo].[SysFile]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
Row Count (~)1
Created4:57:08 PM Thursday, September 7, 2006
Last Modified9:16:28 AM Friday, November 8, 2024
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentityDefault
Cluster Primary Key PK_SysFile: PriKeyPriKeyint4
No
1 - 1
ServiceStartTimedatetime8
No
UserDefinedLabel1varchar(30)30
Yes
UserDefinedLabel2varchar(30)30
Yes
UserDefinedLabel3varchar(30)30
Yes
UserDefinedLabel4varchar(30)30
Yes
UserDefinedLabel5varchar(30)30
Yes
UserDefinedLabel6varchar(30)30
Yes
UserDefinedLabel7varchar(30)30
Yes
UserDefinedLabel8varchar(30)30
Yes
UserDefinedActive1int4
Yes
UserDefinedActive2int4
Yes
UserDefinedActive3int4
Yes
UserDefinedActive4int4
Yes
UserDefinedActive5int4
Yes
UserDefinedActive6int4
Yes
UserDefinedActive7int4
Yes
UserDefinedActive8int4
Yes
OutlookCalendarint4
Yes
VLAutoDispatchbit1
Yes
DriverDivisionOptionFlagbit1
Yes
InvoiceManualAddressFlagbit1
Yes
Key1varchar(512)512
Yes
Key2varchar(512)512
Yes
Foreign Keys FK_SysFile_CountryCodeStandard: [dbo].[CountryCodeStandard].CountryCodeStandardFIDCountryCodeStandardFIDint4
Yes
Foreign Keys FK_SysFile_PaymentCode: [dbo].[PaymentCode].PaymentCodeFIDPaymentCodeFIDint4
Yes
UseDefaultEmailbit1
No
((0))
OutlookEmailbit1
No
((0))
CustomTitlenvarchar(120)240
Yes
Foreign Keys FK_SysFile_DayInWeek: [dbo].[DayInWeek].WorkWeekStartWorkWeekStartint4
No
Foreign Keys FK_SysFile_LaborRatingGroup: [dbo].[LaborRatingGroup].DefaultLaborRatingGroupDefaultLaborRatingGroupint4
Yes
EnableDuplicateOrderbit1
No
((1))
Key3varchar(512)512
Yes
IncludeSpecialInstructionsOnWorkTicketbit1
No
((1))
Foreign Keys FK_Sysfile_MssTimeZone: [dbo].[MssTimeZone].MssTimeZoneFIDMssTimeZoneFIDint4
Yes
OnlyCommissionLSCrewOnWorkTicketbit1
No
((0))
RestrictSalespersonOrderVisibilitybit1
No
((0))
HideCommissionsFromNonRevenueEntryManagersbit1
No
((0))
AutoPlaceSalesCommissionsOnHoldbit1
No
((0))
MoversConnectTraceIdvarchar(8)8
No
(substring(CONVERT([varchar](40),newid()),(1),(8)))
Indexes Indexes
NameColumnsUniqueFill Factor
Cluster Primary Key PK_SysFile: PriKeyPK_SysFilePriKey
Yes
80
Triggers Triggers
NameANSI Nulls OnQuoted Identifier OnOn
SysFileUdfActiveChanged
Yes
Yes
After Update
Foreign Keys Foreign Keys
NameColumns
FK_SysFile_CountryCodeStandardCountryCodeStandardFID->[dbo].[CountryCodeStandard].[CountryCodeStandardID]
FK_SysFile_LaborRatingGroupDefaultLaborRatingGroup->[dbo].[LaborRatingGroup].[LaborRatingGroupID]
FK_Sysfile_MssTimeZoneMssTimeZoneFID->[dbo].[MssTimeZone].[MssTimeZoneID]
FK_SysFile_PaymentCodePaymentCodeFID->[dbo].[PaymentCode].[PaymentCodePriKey]
FK_SysFile_DayInWeekWorkWeekStart->[dbo].[DayInWeek].[DayInWeekID]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[SysFile]
(
[PriKey] [int] NOT NULL IDENTITY(1, 1),
[ServiceStartTime] [datetime] NOT NULL,
[UserDefinedLabel1] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[UserDefinedLabel2] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[UserDefinedLabel3] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[UserDefinedLabel4] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[UserDefinedLabel5] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[UserDefinedLabel6] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[UserDefinedLabel7] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[UserDefinedLabel8] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[UserDefinedActive1] [int] NULL,
[UserDefinedActive2] [int] NULL,
[UserDefinedActive3] [int] NULL,
[UserDefinedActive4] [int] NULL,
[UserDefinedActive5] [int] NULL,
[UserDefinedActive6] [int] NULL,
[UserDefinedActive7] [int] NULL,
[UserDefinedActive8] [int] NULL,
[OutlookCalendar] [int] NULL,
[VLAutoDispatch] [bit] NULL,
[DriverDivisionOptionFlag] [bit] NULL,
[InvoiceManualAddressFlag] [bit] NULL,
[Key1] [varchar] (512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Key2] [varchar] (512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CountryCodeStandardFID] [int] NULL,
[PaymentCodeFID] [int] NULL,
[UseDefaultEmail] [bit] NOT NULL CONSTRAINT [DF_SysFile_UseDefaultEmail] DEFAULT ((0)),
[OutlookEmail] [bit] NOT NULL CONSTRAINT [DF_SysFile_OutlookEmail] DEFAULT ((0)),
[CustomTitle] [nvarchar] (120) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[WorkWeekStart] [int] NOT NULL,
[DefaultLaborRatingGroup] [int] NULL,
[EnableDuplicateOrder] [bit] NOT NULL CONSTRAINT [DF_SysFile_EnableDuplicateOrder] DEFAULT ((1)),
[Key3] [varchar] (512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[IncludeSpecialInstructionsOnWorkTicket] [bit] NOT NULL CONSTRAINT [DF_SysFile_IncludeSpecialInstructionsOnWorkTicket] DEFAULT ((1)),
[MssTimeZoneFID] [int] NULL,
[OnlyCommissionLSCrewOnWorkTicket] [bit] NOT NULL CONSTRAINT [DF_SysFile_OnlyCommissionLSCrewOnWorkTicket] DEFAULT ((0)),
[RestrictSalespersonOrderVisibility] [bit] NOT NULL CONSTRAINT [DF_RestrictSalespersonOrderVisibility] DEFAULT ((0)),
[HideCommissionsFromNonRevenueEntryManagers] [bit] NOT NULL CONSTRAINT [DF_HideCommissionsFromNonRevenueEntryManagers] DEFAULT ((0)),
[AutoPlaceSalesCommissionsOnHold] [bit] NOT NULL CONSTRAINT [DF_AutoPlaceSalesCommissionsOnHold] DEFAULT ((0)),
[MoversConnectTraceId] [varchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_SysFile_MoversConnectTraceId] DEFAULT (substring(CONVERT([varchar](40),newid()),(1),(8)))
) ON [PRIMARY]
GO

create trigger [dbo].[SysFileUdfActiveChanged] on [dbo].[SysFile]
after update
as
set nocount on
declare @theUserDefinedLabel varchar(20) = 'User Defined Label '
declare @theInactiveField varchar(20) = '  *Inactive Field*'
if( update( UserDefinedActive1 ) )
begin
    update SUDFNumber set
        [Description] = @theUserDefinedLabel + ltrim( str( SUDFNumber.SUDFNumberID ) ) + case when inserted.UserDefinedActive1 = 0 then @theInactiveField else '' end
    from inserted
    inner join SUDFNumber on SUDFNumber.SUDFNumberID = 1
end
if( update( UserDefinedActive2 ) )
begin
    update SUDFNumber set
        [Description] = @theUserDefinedLabel + ltrim( str( SUDFNumber.SUDFNumberID ) ) + case when inserted.UserDefinedActive2 = 0 then @theInactiveField else '' end
    from inserted
    inner join SUDFNumber on SUDFNumber.SUDFNumberID = 2
end
if( update( UserDefinedActive3 ) )
begin
    update SUDFNumber set
        [Description] = @theUserDefinedLabel + ltrim( str( SUDFNumber.SUDFNumberID ) ) + case when inserted.UserDefinedActive3 = 0 then @theInactiveField else '' end
    from inserted
    inner join SUDFNumber on SUDFNumber.SUDFNumberID = 3
end
if( update( UserDefinedActive4 ) )
begin
    update SUDFNumber set
        [Description] = @theUserDefinedLabel + ltrim( str( SUDFNumber.SUDFNumberID ) ) + case when inserted.UserDefinedActive4 = 0 then @theInactiveField else '' end
    from inserted
    inner join SUDFNumber on SUDFNumber.SUDFNumberID = 4
end
if( update( UserDefinedActive5 ) )
begin
    update SUDFNumber set
        [Description] = @theUserDefinedLabel + ltrim( str( SUDFNumber.SUDFNumberID ) ) + case when inserted.UserDefinedActive5 = 0 then @theInactiveField else '' end
    from inserted
    inner join SUDFNumber on SUDFNumber.SUDFNumberID = 5
end
if( update( UserDefinedActive6 ) )
begin
    update SUDFNumber set
        [Description] = @theUserDefinedLabel + ltrim( str( SUDFNumber.SUDFNumberID ) ) + case when inserted.UserDefinedActive6 = 0 then @theInactiveField else '' end
    from inserted
    inner join SUDFNumber on SUDFNumber.SUDFNumberID = 6
end
if( update( UserDefinedActive7 ) )
begin
    update SUDFNumber set
        [Description] = @theUserDefinedLabel + ltrim( str( SUDFNumber.SUDFNumberID ) ) + case when inserted.UserDefinedActive7 = 0 then @theInactiveField else '' end
    from inserted
    inner join SUDFNumber on SUDFNumber.SUDFNumberID = 7
end
if( update( UserDefinedActive8 ) )
begin
    update SUDFNumber set
        [Description] = @theUserDefinedLabel + ltrim( str( SUDFNumber.SUDFNumberID ) ) + case when inserted.UserDefinedActive8 = 0 then @theInactiveField else '' end
    from inserted
    inner join SUDFNumber on SUDFNumber.SUDFNumberID = 8
end
GO
ALTER TABLE [dbo].[SysFile] ADD CONSTRAINT [PK_SysFile] PRIMARY KEY CLUSTERED  ([PriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SysFile] ADD CONSTRAINT [FK_SysFile_CountryCodeStandard] FOREIGN KEY ([CountryCodeStandardFID]) REFERENCES [dbo].[CountryCodeStandard] ([CountryCodeStandardID])
GO
ALTER TABLE [dbo].[SysFile] ADD CONSTRAINT [FK_SysFile_LaborRatingGroup] FOREIGN KEY ([DefaultLaborRatingGroup]) REFERENCES [dbo].[LaborRatingGroup] ([LaborRatingGroupID])
GO
ALTER TABLE [dbo].[SysFile] ADD CONSTRAINT [FK_Sysfile_MssTimeZone] FOREIGN KEY ([MssTimeZoneFID]) REFERENCES [dbo].[MssTimeZone] ([MssTimeZoneID])
GO
ALTER TABLE [dbo].[SysFile] ADD CONSTRAINT [FK_SysFile_PaymentCode] FOREIGN KEY ([PaymentCodeFID]) REFERENCES [dbo].[PaymentCode] ([PaymentCodePriKey])
GO
ALTER TABLE [dbo].[SysFile] ADD CONSTRAINT [FK_SysFile_DayInWeek] FOREIGN KEY ([WorkWeekStart]) REFERENCES [dbo].[DayInWeek] ([DayInWeekID])
GO
GRANT SELECT ON  [dbo].[SysFile] TO [MssExec]
GRANT INSERT ON  [dbo].[SysFile] TO [MssExec]
GRANT DELETE ON  [dbo].[SysFile] TO [MssExec]
GRANT UPDATE ON  [dbo].[SysFile] TO [MssExec]
GO
Uses
Used By