Tables [dbo].[ServiceDetailOrderMap]
Properties
PropertyValue
HeapYes
Row Count (~)0
Created9:00:34 AM Friday, December 7, 2018
Last Modified9:00:51 AM Friday, December 7, 2018
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentityDefault
Primary Key PK_ServiceDetailOrderMap: ServiceDetailOrderMapIDServiceDetailOrderMapIDint4
No
1 - 1
Foreign Keys FK_ServiceDetailOrderMap_ServiceDetail: [dbo].[ServiceDetail].ServiceDetailFIDIndexes IX_ServiceDetailOrderMap_OrderService: OrderFID\ServiceDetailFIDServiceDetailFIDint4
No
Foreign Keys FK_ServiceDetailOrderMap_Order: [dbo].[Orders].OrderFIDIndexes IX_ServiceDetailOrderMap_OrderService: OrderFID\ServiceDetailFIDOrderFIDint4
No
Moverbit1
No
((0))
Clientbit1
No
((0))
Indexes Indexes
NameColumnsUnique
Primary Key PK_ServiceDetailOrderMap: ServiceDetailOrderMapIDPK_ServiceDetailOrderMapServiceDetailOrderMapID
Yes
IX_ServiceDetailOrderMap_OrderServiceOrderFID, ServiceDetailFID
Yes
Check Constraints Check Constraints
NameConstraint
CK_ServiceDetailOrderMapFlagSetup([Mover]=(1) AND [Client]=(0) OR [Mover]=(0) AND [Client]=(1))
Foreign Keys Foreign Keys
NameDeleteColumns
FK_ServiceDetailOrderMap_OrderOrderFID->[dbo].[Orders].[PriKey]
FK_ServiceDetailOrderMap_ServiceDetailCascadeServiceDetailFID->[dbo].[ServiceDetail].[ServiceDetailID]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[ServiceDetailOrderMap]
(
[ServiceDetailOrderMapID] [int] NOT NULL IDENTITY(1, 1),
[ServiceDetailFID] [int] NOT NULL,
[OrderFID] [int] NOT NULL,
[Mover] [bit] NOT NULL CONSTRAINT [DF_ServiceDetailOrderMap_Mover] DEFAULT ((0)),
[Client] [bit] NOT NULL CONSTRAINT [DF_ServiceDetailOrderMap_Client] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ServiceDetailOrderMap] ADD CONSTRAINT [CK_ServiceDetailOrderMapFlagSetup] CHECK (([Mover]=(1) AND [Client]=(0) OR [Mover]=(0) AND [Client]=(1)))
GO
ALTER TABLE [dbo].[ServiceDetailOrderMap] ADD CONSTRAINT [PK_ServiceDetailOrderMap] PRIMARY KEY NONCLUSTERED  ([ServiceDetailOrderMapID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ServiceDetailOrderMap] ADD CONSTRAINT [IX_ServiceDetailOrderMap_OrderService] UNIQUE NONCLUSTERED  ([OrderFID], [ServiceDetailFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ServiceDetailOrderMap] ADD CONSTRAINT [FK_ServiceDetailOrderMap_Order] FOREIGN KEY ([OrderFID]) REFERENCES [dbo].[Orders] ([PriKey])
GO
ALTER TABLE [dbo].[ServiceDetailOrderMap] ADD CONSTRAINT [FK_ServiceDetailOrderMap_ServiceDetail] FOREIGN KEY ([ServiceDetailFID]) REFERENCES [dbo].[ServiceDetail] ([ServiceDetailID]) ON DELETE CASCADE
GO
GRANT SELECT ON  [dbo].[ServiceDetailOrderMap] TO [MssExec]
GRANT INSERT ON  [dbo].[ServiceDetailOrderMap] TO [MssExec]
GRANT DELETE ON  [dbo].[ServiceDetailOrderMap] TO [MssExec]
GRANT UPDATE ON  [dbo].[ServiceDetailOrderMap] TO [MssExec]
GO
Uses