Tables [dbo].[OrderCompletedStatusHistory]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
Row Count (~)0
Created9:35:18 AM Friday, December 7, 2018
Last Modified9:35:19 AM Friday, December 7, 2018
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentity
Cluster Primary Key PK_OrderCompletedStatusHistory: OrderFID\OrderCompletedStatusHistoryIDOrderCompletedStatusHistoryIDbigint8
No
1 - 1
Cluster Primary Key PK_OrderCompletedStatusHistory: OrderFID\OrderCompletedStatusHistoryIDForeign Keys FK_OrderCompletedStatusHistory_Orders: [dbo].[Orders].OrderFIDIndexes IX_OrderCompletedStatusHistory_ChangedOn_OrderFID: ChangedOn\OrderFIDOrderFIDint4
No
ChangedByint4
No
Indexes IX_OrderCompletedStatusHistory_ChangedOn_OrderFID: ChangedOn\OrderFIDChangedOndatetime8
No
ChangedInvarchar(64)64
Yes
Indexes Indexes
NameColumnsUnique
Cluster Primary Key PK_OrderCompletedStatusHistory: OrderFID\OrderCompletedStatusHistoryIDPK_OrderCompletedStatusHistoryOrderFID, OrderCompletedStatusHistoryID
Yes
IX_OrderCompletedStatusHistory_ChangedOn_OrderFIDChangedOn, OrderFID
Foreign Keys Foreign Keys
NameDeleteColumns
FK_OrderCompletedStatusHistory_OrdersCascadeOrderFID->[dbo].[Orders].[PriKey]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[OrderCompletedStatusHistory]
(
[OrderCompletedStatusHistoryID] [bigint] NOT NULL IDENTITY(1, 1),
[OrderFID] [int] NOT NULL,
[ChangedBy] [int] NOT NULL,
[ChangedOn] [datetime] NOT NULL,
[ChangedIn] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OrderCompletedStatusHistory] ADD CONSTRAINT [PK_OrderCompletedStatusHistory] PRIMARY KEY CLUSTERED  ([OrderFID], [OrderCompletedStatusHistoryID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_OrderCompletedStatusHistory_ChangedOn_OrderFID] ON [dbo].[OrderCompletedStatusHistory] ([ChangedOn], [OrderFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OrderCompletedStatusHistory] ADD CONSTRAINT [FK_OrderCompletedStatusHistory_Orders] FOREIGN KEY ([OrderFID]) REFERENCES [dbo].[Orders] ([PriKey]) ON DELETE CASCADE
GO
GRANT SELECT ON  [dbo].[OrderCompletedStatusHistory] TO [MssExec]
GRANT INSERT ON  [dbo].[OrderCompletedStatusHistory] TO [MssExec]
GRANT DELETE ON  [dbo].[OrderCompletedStatusHistory] TO [MssExec]
GRANT UPDATE ON  [dbo].[OrderCompletedStatusHistory] TO [MssExec]
GO
Uses