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