Tables [dbo].[OrderLocations]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
Row Count (~)0
Created9:14:38 AM Friday, December 7, 2018
Last Modified9:14:56 AM Friday, December 7, 2018
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentityDefault
Cluster Primary Key PK_OrderLocations: OrderLocationIDOrderLocationIDint4
No
1 - 1
Foreign Keys FK_OrderLocations_OrderFID: [dbo].[Orders].OrderFIDIndexes ix_OrderLocations_Order: OrderFIDOrderFIDint4
No
Namevarchar(100)100
No
Foreign Keys FK_OrderLocations_OrderContactFID: [dbo].[OrderContacts].OrderContactFIDOrderContactFIDint4
Yes
ImportedFlagbit1
No
((0))
Foreign Keys FK_OrderLocations_BuildingFID: [dbo].[Buildings].BuildingFIDBuildingFIDint4
Yes
CrossStreetvarchar(1024)1024
Yes
ServiceEntrancevarchar(1024)1024
Yes
SiteNotevarchar(1024)1024
Yes
Foreign Keys FK_OrderLocations_OrderLocationAddressTypeFID: [dbo].[OrderLocationAddressType].OrderLocationAddressTypeFIDOrderLocationAddressTypeFIDint4
Yes
Indexes Indexes
NameColumnsUnique
Cluster Primary Key PK_OrderLocations: OrderLocationIDPK_OrderLocationsOrderLocationID
Yes
ix_OrderLocations_OrderOrderFID
Foreign Keys Foreign Keys
NameDeleteColumns
FK_OrderLocations_BuildingFIDSetNullBuildingFID->[dbo].[Buildings].[BuildingID]
FK_OrderLocations_OrderContactFIDCascadeOrderContactFID->[dbo].[OrderContacts].[OrderContactID]
FK_OrderLocations_OrderFIDOrderFID->[dbo].[Orders].[PriKey]
FK_OrderLocations_OrderLocationAddressTypeFIDOrderLocationAddressTypeFID->[dbo].[OrderLocationAddressType].[OrderLocationAddressTypeID]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[OrderLocations]
(
[OrderLocationID] [int] NOT NULL IDENTITY(1, 1),
[OrderFID] [int] NOT NULL,
[Name] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[OrderContactFID] [int] NULL,
[ImportedFlag] [bit] NOT NULL CONSTRAINT [DF_OrderLocations_ImportedFlag] DEFAULT ((0)),
[BuildingFID] [int] NULL,
[CrossStreet] [varchar] (1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ServiceEntrance] [varchar] (1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[SiteNote] [varchar] (1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[OrderLocationAddressTypeFID] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OrderLocations] ADD CONSTRAINT [PK_OrderLocations] PRIMARY KEY CLUSTERED  ([OrderLocationID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [ix_OrderLocations_Order] ON [dbo].[OrderLocations] ([OrderFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OrderLocations] ADD CONSTRAINT [FK_OrderLocations_BuildingFID] FOREIGN KEY ([BuildingFID]) REFERENCES [dbo].[Buildings] ([BuildingID]) ON DELETE SET NULL
GO
ALTER TABLE [dbo].[OrderLocations] ADD CONSTRAINT [FK_OrderLocations_OrderContactFID] FOREIGN KEY ([OrderContactFID]) REFERENCES [dbo].[OrderContacts] ([OrderContactID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[OrderLocations] ADD CONSTRAINT [FK_OrderLocations_OrderFID] FOREIGN KEY ([OrderFID]) REFERENCES [dbo].[Orders] ([PriKey])
GO
ALTER TABLE [dbo].[OrderLocations] ADD CONSTRAINT [FK_OrderLocations_OrderLocationAddressTypeFID] FOREIGN KEY ([OrderLocationAddressTypeFID]) REFERENCES [dbo].[OrderLocationAddressType] ([OrderLocationAddressTypeID])
GO
GRANT SELECT ON  [dbo].[OrderLocations] TO [MssExec]
GRANT INSERT ON  [dbo].[OrderLocations] TO [MssExec]
GRANT DELETE ON  [dbo].[OrderLocations] TO [MssExec]
GRANT UPDATE ON  [dbo].[OrderLocations] TO [MssExec]
GO
Uses
Used By