IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[MailAddressesHidden]') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
BEGIN
  CREATE TABLE [dbo].[MailAddressesHidden]
  (
    [CustomerNumber] [int] NOT NULL,
    [MailAddress] [varchar](100) NOT NULL,
    [MailAddressType] [tinyint] NOT NULL
  ) ON [PRIMARY]

  ALTER TABLE [dbo].[MailAddressesHidden]  WITH CHECK ADD  CONSTRAINT [FK_MailAddressesHidden_Customer] FOREIGN KEY([CustomerNumber])
  REFERENCES [dbo].[Customer] ([CustomerNumber])

  ALTER TABLE [dbo].[MailAddressesHidden] CHECK CONSTRAINT [FK_MailAddressesHidden_Customer]
END