if not exists (SELECT * FROM sys.indexes WHERE name = 'IX_ConnectionLog_CustomerID' AND object_id = OBJECT_ID(N'dbo.ConnectionLog'))
BEGIN
    create nonclustered index IX_ConnectionLog_CustomerID on dbo.ConnectionLog (CustomerID)
END