IF NOT EXISTS (SELECT Name FROM SysIndexes  WITH (NOLOCK) WHERE Name = 'IX_ConferenceRoomsDateTableHotel')
CREATE NONCLUSTERED INDEX [IX_ConferenceRoomsDateTableHotel] ON [dbo].[CONFERENCEROOMS]
(
	[TableDate] ASC,
	[Istable] ASC,
	[HotelNumber] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO

IF NOT EXISTS (SELECT Name FROM SysIndexes  WITH (NOLOCK) WHERE Name = 'IX_ConferenceRoomsNumberIsTableChairNumberHotelNumber')
CREATE NONCLUSTERED INDEX [IX_ConferenceRoomsNumberIsTableChairNumberHotelNumber] ON [dbo].[CONFERENCEROOMS]
(
	[Number] ASC,
	[Istable] ASC,
	[ChairNumber] ASC,
	[HotelNumber] ASC
 ) INCLUDE (TableDate) ON [PRIMARY] 
GO

IF NOT EXISTS (SELECT Name FROM SysIndexes WITH (NOLOCK) WHERE Name = 'IX_KitchenStatement_FolioNumber')
CREATE NONCLUSTERED INDEX [IX_KitchenStatement_FolioNumber] ON [dbo].[KitchenStatement]
(
	[FolioNumber] DESC
 ) ON [PRIMARY] 
GO

IF NOT EXISTS (SELECT Name FROM SysIndexes  WITH (NOLOCK) WHERE Name = 'IX_ReservationRoomline_Products')
	CREATE NONCLUSTERED INDEX [IX_ReservationRoomline_Products]
	ON [dbo].[RESERVATIONROOMLINE] ([RoomNumber])
	INCLUDE ([LINENUMBER],[ArrivalDate],[ArrivalTime],[DepartureDate],[DepartureTime],[ProductNumber],[ProductNumber2],[ProductNumber3],[ProductNumber4])
GO



IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[RESERVATIONADDRESS]') AND name = N'IX_RESERVATIONADDRESS')
DROP INDEX [IX_RESERVATIONADDRESS] ON [dbo].[RESERVATIONADDRESS]
GO

/****** Object:  Index [IX_RESERVATIONADDRESS_ATTENTIONNAME]    Script Date: 21-09-2022 18:22:57 ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[RESERVATIONADDRESS]') AND name = N'IX_RESERVATIONADDRESS_ATTENTIONNAME')
CREATE NONCLUSTERED INDEX [IX_RESERVATIONADDRESS_ATTENTIONNAME] ON [dbo].[RESERVATIONADDRESS]
(
	[ATTENTIONNAME] ASC
) INCLUDE ([AddressAnonymized],[AddressNumber] )
GO
SET ANSI_PADDING ON
GO
/****** Object:  Index [IX_RESERVATIONADDRESS_FIRSTNAME]    Script Date: 21-09-2022 18:22:57 ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[RESERVATIONADDRESS]') AND name = N'IX_RESERVATIONADDRESS_FIRSTNAME')
CREATE NONCLUSTERED INDEX [IX_RESERVATIONADDRESS_FIRSTNAME] ON [dbo].[RESERVATIONADDRESS]
(
	[FIRSTNAME] ASC
) INCLUDE ([AddressAnonymized],[AddressNumber] )
GO
SET ANSI_PADDING ON
GO
/****** Object:  Index [IX_RESERVATIONADDRESS_LASTNAME]    Script Date: 21-09-2022 18:22:57 ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[RESERVATIONADDRESS]') AND name = N'IX_RESERVATIONADDRESS_LASTNAME')
CREATE NONCLUSTERED INDEX [IX_RESERVATIONADDRESS_LASTNAME] ON [dbo].[RESERVATIONADDRESS]
(
	[LASTNAME] ASC
) INCLUDE ([AddressAnonymized],[AddressNumber] )
GO
/****** Object:  Index [[IX_RESERVATIONADDRESS_EMAIL]]    Script Date: 21-09-2022 18:22:57 ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[RESERVATIONADDRESS]') AND name = N'IX_RESERVATIONADDRESS_EMAIL')
CREATE NONCLUSTERED INDEX [IX_RESERVATIONADDRESS_EMAIL] ON [dbo].[RESERVATIONADDRESS]
(
	[EMAIL] ASC
) INCLUDE ([AddressAnonymized],[AddressNumber] )
GO
/****** Object:  Index [[IX_RESERVATIONADDRESS_PHONE]]    Script Date: 21-09-2022 18:22:57 ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[RESERVATIONADDRESS]') AND name = N'IX_RESERVATIONADDRESS_PHONE')
CREATE NONCLUSTERED INDEX [IX_RESERVATIONADDRESS_PHONE] ON [dbo].[RESERVATIONADDRESS]
(
	[PHONE] ASC
) INCLUDE ([AddressAnonymized],[AddressNumber] )
GO
/****** Object:  Index [[IX_RESERVATIONADDRESS_ADDRESS1]]    Script Date: 21-09-2022 18:22:57 ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[RESERVATIONADDRESS]') AND name = N'IX_RESERVATIONADDRESS_ADDRESS1')
CREATE NONCLUSTERED INDEX [IX_RESERVATIONADDRESS_ADDRESS1] ON [dbo].[RESERVATIONADDRESS]
(
	[ADDRESS1] ASC
) INCLUDE ([AddressAnonymized],[AddressNumber] )
GO

/****** Object:  Index [IX_ProductPricePacket_Product_Packet]    Script Date: 07-10-2022 09:06:22 ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[ProductPricePacket]') AND name = N'IX_ProductPricePacket_Product_Packet')
CREATE NONCLUSTERED INDEX [IX_ProductPricePacket_Product_Packet] ON [dbo].[ProductPricePacket]
(
	[FK_ProductNumber] ASC,
	[PacketType] ASC,
	[StartDate] ASC,
	[EndDate] ASC,
	[FK_PacketNumber] ASC
) INCLUDE ([Id])
GO
IF NOT EXISTS (SELECT * FROM SysIndexes WITH (NOLOCK) WHERE Name = 'IX_FOLIOS_OpenFolio')
CREATE NONCLUSTERED INDEX [IX_FOLIOS_OpenFolio] ON [dbo].[Folios]
(
	[OpenFolio] ASC,
	[HotelCustomerNumber] ASC,
	[ReferenceNumber] ASC,
	[FkFolio] ASC,
	[FolioNumber] ASC,
	[ReservationAddressNumber] ASC
) ON [PRIMARY] 
GO
IF NOT EXISTS (SELECT * FROM SysIndexes WITH (NOLOCK) WHERE Name = 'IX_TransactionKitchenStatementXTab_KSN')
CREATE NONCLUSTERED INDEX [IX_TransactionKitchenStatementXTab_KSN] ON [dbo].[TransactionKitchenStatementXTab]
(
	[KitchenStatementNumber] ASC
) ON [PRIMARY]
GO
