-- Adding ContactpersonCustomerNumber to the index

IF EXISTS (SELECT name FROM SysIndexes WITH (NOLOCK) WHERE name = 
            'IX_CustomerOrdreBook')
begin
	DROP INDEX dbo.CustomerOrdreBook.IX_CustomerOrdreBook


	CREATE NONCLUSTERED INDEX [IX_CustomerOrdreBook] ON [dbo].[CustomerOrdreBook] 
	(
		[CustomerNumber] DESC,
		[ContactpersonCustomerNumber] DESC,
		[SegmentNumber] ASC,
		[DateForValue] ASC,
		[HotelCustomerNumber] ASC,
		[ReservationStatus] ASC,
		[ReadOnly] ASC
	)
end