Tables [dbo].[OrderInstructions]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
Row Count (~)39426
Created4:57:08 PM Thursday, September 7, 2006
Last Modified3:46:15 PM Tuesday, November 18, 2014
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentity
Cluster Primary Key PK_OrderInstructions: OrderInstructionsIDOrderInstructionsIDint4
No
1 - 1
Foreign Keys FK_OrderInstructions_OrderInstructionTypes: [dbo].[OrderInstructionTypes].OrderInstructionTypeFIDIndexes IX_OrderInstructions_OrderInstructionType_Order: OrderInstructionTypeFID\OrderFID\OriginDestinationOrderInstructionTypeFIDint4
No
Foreign Keys FK_OrderInstructions_Orders: [dbo].[Orders].OrderFIDIndexes IX_OrderInstructions_OrderFID: OrderFIDIndexes IX_OrderInstructions_OrderInstructionType_Order: OrderInstructionTypeFID\OrderFID\OriginDestinationOrderFIDint4
No
Foreign Keys FK_OrderInstructions_Sysuser: [dbo].[Sysuser].SysUserFIDIndexes IX_OrderInstructions_SysUserFID: SysUserFIDSysUserFIDint4
No
Datedatetime8
No
Instructionvarchar(1024)1024
No
Indexes IX_OrderInstructions_OrderInstructionType_Order: OrderInstructionTypeFID\OrderFID\OriginDestinationOriginDestinationvarchar(1)1
No
Indexes Indexes
NameColumnsUniqueFill Factor
Cluster Primary Key PK_OrderInstructions: OrderInstructionsIDPK_OrderInstructionsOrderInstructionsID
Yes
80
IX_OrderInstructions_OrderInstructionType_OrderOrderInstructionTypeFID, OrderFID, OriginDestination
Yes
80
IX_OrderInstructions_OrderFIDOrderFID
IX_OrderInstructions_SysUserFIDSysUserFID
Foreign Keys Foreign Keys
NameColumns
FK_OrderInstructions_OrdersOrderFID->[dbo].[Orders].[PriKey]
FK_OrderInstructions_OrderInstructionTypesOrderInstructionTypeFID->[dbo].[OrderInstructionTypes].[OrderInstructionTypeID]
FK_OrderInstructions_SysuserSysUserFID->[dbo].[Sysuser].[SysUserID]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[OrderInstructions]
(
[OrderInstructionsID] [int] NOT NULL IDENTITY(1, 1),
[OrderInstructionTypeFID] [int] NOT NULL,
[OrderFID] [int] NOT NULL,
[SysUserFID] [int] NOT NULL,
[Date] [datetime] NOT NULL,
[Instruction] [varchar] (1024) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[OriginDestination] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OrderInstructions] ADD CONSTRAINT [PK_OrderInstructions] PRIMARY KEY CLUSTERED  ([OrderInstructionsID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OrderInstructions] ADD CONSTRAINT [IX_OrderInstructions_OrderInstructionType_Order] UNIQUE NONCLUSTERED  ([OrderInstructionTypeFID], [OrderFID], [OriginDestination]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_OrderInstructions_OrderFID] ON [dbo].[OrderInstructions] ([OrderFID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_OrderInstructions_SysUserFID] ON [dbo].[OrderInstructions] ([SysUserFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OrderInstructions] ADD CONSTRAINT [FK_OrderInstructions_Orders] FOREIGN KEY ([OrderFID]) REFERENCES [dbo].[Orders] ([PriKey])
GO
ALTER TABLE [dbo].[OrderInstructions] ADD CONSTRAINT [FK_OrderInstructions_OrderInstructionTypes] FOREIGN KEY ([OrderInstructionTypeFID]) REFERENCES [dbo].[OrderInstructionTypes] ([OrderInstructionTypeID])
GO
ALTER TABLE [dbo].[OrderInstructions] ADD CONSTRAINT [FK_OrderInstructions_Sysuser] FOREIGN KEY ([SysUserFID]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
GRANT SELECT ON  [dbo].[OrderInstructions] TO [MssExec]
GRANT INSERT ON  [dbo].[OrderInstructions] TO [MssExec]
GRANT DELETE ON  [dbo].[OrderInstructions] TO [MssExec]
GRANT UPDATE ON  [dbo].[OrderInstructions] TO [MssExec]
GO
Uses