if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[RoomTypeDifferentialPerDate]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
BEGIN
  CREATE TABLE [dbo].[RoomTypeDifferentialPerDate](
    [Id] [int] IDENTITY(1,1) NOT NULL,
    [FK_RoomTypeDifferentialId] [int] NOT NULL,
    [DateStamp] [datetime] NOT NULL,
    [ShowRoomOption] [smallint] NOT NULL,
   CONSTRAINT [PK_RoomTypeDifferentialPerDate] PRIMARY KEY CLUSTERED 
  (
	  [Id] ASC
  )
  ) ON [PRIMARY]

  if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[RoomTypeDifferential]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
  BEGIN
    ALTER TABLE [dbo].[RoomTypeDifferentialPerDate]  WITH CHECK ADD  CONSTRAINT [FK_RoomTypeDifferentialPerDate_RoomTypeDifferential] FOREIGN KEY([FK_RoomTypeDifferentialId])
    REFERENCES [dbo].[RoomTypeDifferential] ([Id])
    ALTER TABLE [dbo].[RoomTypeDifferentialPerDate] CHECK CONSTRAINT [FK_RoomTypeDifferentialPerDate_RoomTypeDifferential]
  END

END