if not exists (select * from sys.indexes where name = 'IX_ConnectionLog_ConnectionID' and object_id = object_id(N'dbo.ConnectionLog'))
    create nonclustered index IX_ConnectionLog_ConnectionID on dbo.ConnectionLog (ConnectionID)