IF NOT EXISTS (SELECT Name FROM SysIndexes WITH (NOLOCK) WHERE Name = 'IX_MISTable_ReturningGuest')
BEGIN
  CREATE NONCLUSTERED INDEX IX_MISTable_ReturningGuest
  ON [dbo].[MISTable] ([ReservationStatus])
  INCLUDE ([DateStamp],[BookedNumberOfRooms],[ActualNumberOfRooms],[ReferenceNumber],[GuestNumber])
END
GO

IF NOT EXISTS (SELECT Name FROM SysIndexes WITH (NOLOCK) WHERE Name = 'IX_MISTable_ReturningGuest1')
BEGIN
  CREATE NONCLUSTERED INDEX IX_MISTable_ReturningGuest1
  ON [dbo].[MISTable] ([ReferenceNumber],[GuestNumber],[DateStamp],[ReservationStatus])
  INCLUDE ([BookedNumberOfRooms],[ActualNumberOfRooms])
END
GO