IF NOT EXISTS (SELECT Name FROM SysIndexes  WITH (NOLOCK) WHERE Name = 'IX_ArrangementLines_WareNumber')
  CREATE NONCLUSTERED INDEX IX_ArrangementLines_WareNumber ON
   ArrangementLines (WareNumber) INCLUDE (ArrangementLineNumber, Date, Time, Pieces, DepartureTime)
GO