IF NOT EXISTS (SELECT Name FROM SysIndexes  WITH (NOLOCK) WHERE Name = 'IX_MadeOrdrebook')
CREATE NONCLUSTERED INDEX IX_MadeOrdrebook
ON [dbo].[Transactions] ([ShowOnBillFlag])
INCLUDE ([TransactionNumber],[UserIDNumber],[FolioNumber],[Pieces],[PriceOverwrite],[PAXadult],[PAXchild1],[PAXchild2],[Debit],[MovedDeleted],[MovedFolioNr],[WareNumber],[ProductNumber],[GuestNumber],[OriginalDate],[HotelCustomerNumber])
GO

IF NOT EXISTS (SELECT Name FROM SysIndexes  WITH (NOLOCK) WHERE Name = 'IX_MadeOrdrebookRes')
CREATE NONCLUSTERED INDEX IX_MadeOrdrebookRes
ON [dbo].[Reservations] ([Status])
INCLUDE ([ReferenceNumber],[GuestNumber],[MarketSegment])
GO