IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[CustomerPicture]') AND type in (N'U'))
BEGIN
  CREATE TABLE [dbo].[CustomerPicture]
  (
    [CustomerNumber] [int] NOT NULL,
    [ImageType] [varchar](10) NOT NULL,
    [ImageData] [image] NOT NULL,
    CONSTRAINT [PK_CustomerPicture] PRIMARY KEY CLUSTERED 
    (
      [CustomerNumber] ASC
    )
  ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

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

  ALTER TABLE [dbo].[CustomerPicture] CHECK CONSTRAINT [FK_CustomerPicture_Customer]
END