CREATE TABLE [dbo].[Market]
(
[MarketID] [int] NOT NULL IDENTITY(1, 1),
[Description] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[ExternalCode] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Market] ADD CONSTRAINT [PK_Market] PRIMARY KEY CLUSTERED ([MarketID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Market] ADD CONSTRAINT [IX_Market_Description] UNIQUE NONCLUSTERED ([Description]) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_Market_ExternalCode] ON [dbo].[Market] ([ExternalCode]) WHERE ([ExternalCode] IS NOT NULL) ON [PRIMARY]
GO
GRANT SELECT ON [dbo].[Market] TO [MssExec]
GRANT INSERT ON [dbo].[Market] TO [MssExec]
GRANT DELETE ON [dbo].[Market] TO [MssExec]
GRANT UPDATE ON [dbo].[Market] TO [MssExec]
GO