Tables [dbo].[OrderHistory]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
Row Count (~)43676
Created3:42:54 PM Thursday, December 6, 2018
Last Modified7:33:17 PM Thursday, August 29, 2024
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentity
Cluster Primary Key PK_OrderHistory: OrderFID\OrderHistoryIDOrderHistoryIDbigint8
No
1 - 1
Cluster Primary Key PK_OrderHistory: OrderFID\OrderHistoryIDForeign Keys FK_OrderHistory_Orders: [dbo].[Orders].OrderFIDOrderFIDint4
No
Foreign Keys FK_OrderHistory_SysUserFID: [dbo].[Sysuser].ChangedByChangedByint4
No
ChangedOndatetime8
No
Foreign Keys FK_OrderHistory_OrderHistoryField: [dbo].[OrderHistoryField].OrderHistoryFieldFIDOrderHistoryFieldFIDint4
No
ChangedTovarchar(256)256
Yes
ChangedInvarchar(128)128
Yes
CustomDescriptionvarchar(128)128
Yes
Indexes Indexes
NameColumnsUnique
Cluster Primary Key PK_OrderHistory: OrderFID\OrderHistoryIDPK_OrderHistoryOrderFID, OrderHistoryID
Yes
Foreign Keys Foreign Keys
NameDeleteColumns
FK_OrderHistory_SysUserFIDChangedBy->[dbo].[Sysuser].[SysUserID]
FK_OrderHistory_OrdersCascadeOrderFID->[dbo].[Orders].[PriKey]
FK_OrderHistory_OrderHistoryFieldOrderHistoryFieldFID->[dbo].[OrderHistoryField].[OrderHistoryFieldID]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[OrderHistory]
(
[OrderHistoryID] [bigint] NOT NULL IDENTITY(1, 1),
[OrderFID] [int] NOT NULL,
[ChangedBy] [int] NOT NULL,
[ChangedOn] [datetime] NOT NULL,
[OrderHistoryFieldFID] [int] NOT NULL,
[ChangedTo] [varchar] (256) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ChangedIn] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CustomDescription] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OrderHistory] ADD CONSTRAINT [PK_OrderHistory] PRIMARY KEY CLUSTERED  ([OrderFID], [OrderHistoryID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OrderHistory] ADD CONSTRAINT [FK_OrderHistory_SysUserFID] FOREIGN KEY ([ChangedBy]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
ALTER TABLE [dbo].[OrderHistory] ADD CONSTRAINT [FK_OrderHistory_Orders] FOREIGN KEY ([OrderFID]) REFERENCES [dbo].[Orders] ([PriKey]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[OrderHistory] ADD CONSTRAINT [FK_OrderHistory_OrderHistoryField] FOREIGN KEY ([OrderHistoryFieldFID]) REFERENCES [dbo].[OrderHistoryField] ([OrderHistoryFieldID])
GO
GRANT SELECT ON  [dbo].[OrderHistory] TO [MssExec]
GRANT INSERT ON  [dbo].[OrderHistory] TO [MssExec]
GRANT DELETE ON  [dbo].[OrderHistory] TO [MssExec]
GRANT UPDATE ON  [dbo].[OrderHistory] TO [MssExec]
GO
Uses