CREATE TABLE [dbo].[Warehouse]
(
[WarehousePriKey] [int] NOT NULL IDENTITY(1, 1),
[WarehouseName] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[BranchPriKey] [int] NOT NULL,
[RecurringBillingAvailabilityFlag] [bit] NOT NULL CONSTRAINT [DF_Warehouse_RecurringBillingAvailabilityFlag] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Warehouse] ADD CONSTRAINT [PK_Warehouse] PRIMARY KEY CLUSTERED ([WarehousePriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Warehouse] ADD CONSTRAINT [IX_Warehouse] UNIQUE NONCLUSTERED ([WarehouseName]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Warehouse] ADD CONSTRAINT [FK_Warehouse_Branch] FOREIGN KEY ([BranchPriKey]) REFERENCES [dbo].[Branch] ([BranchPriKey])
GO
GRANT SELECT ON [dbo].[Warehouse] TO [MssExec]
GRANT INSERT ON [dbo].[Warehouse] TO [MssExec]
GRANT DELETE ON [dbo].[Warehouse] TO [MssExec]
GRANT UPDATE ON [dbo].[Warehouse] TO [MssExec]
GO