IF not exists(SELECT * 
FROM sys.indexes 
WHERE name='IX_FK_NB_Item_Enddate' AND object_id = OBJECT_ID('NB_Item'))
BEGIN

CREATE INDEX [IX_FK_NB_Item_Enddate]
ON [dbo].[NB_Item]
    ([Enddate]);

END


IF not exists(SELECT * 
FROM sys.indexes 
WHERE name='IX_FK_NB_Item_Startdate' AND object_id = OBJECT_ID('NB_Item'))
BEGIN

CREATE INDEX [IX_FK_NB_Item_Startdate]
ON [dbo].[NB_Item]
    ([Startdate]);

END
