IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[OTAPostHotelStayInfoNotif]') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
BEGIN
  CREATE TABLE [dbo].[OTAPostHotelStayInfoNotif]
    (
    [FK_OTAPostMainId] [int] NOT NULL,
    [ReferenceNumber] [int] NULL,
    [GuestNumber] [int] NULL,
    [Batch] [bit] NULL,
    CONSTRAINT [PK_OTAPostHotelStayInfoNotif] PRIMARY KEY CLUSTERED 
    (
      [FK_OTAPostMainId] ASC
    )
    ) ON [PRIMARY]

  ALTER TABLE [dbo].[OTAPostHotelStayInfoNotif]  WITH CHECK ADD  CONSTRAINT [FK_OTAPostHotelStayInfoNotif_OTAPostMain] FOREIGN KEY([FK_OTAPostMainId])
  REFERENCES [dbo].[OTAPostMain] ([Id])

  ALTER TABLE [dbo].[OTAPostHotelStayInfoNotif] CHECK CONSTRAINT [FK_OTAPostHotelStayInfoNotif_OTAPostMain]
END