if not exists (select * from sys.indexes where name = 'IX_LoginAttempt_UserName' and object_id = object_id('dbo.LoginAttempt'))
    create index IX_LoginAttempt_UserName on dbo.LoginAttempt (UserName)