if not exists (select * FROM sys.syscolumns where name = 'UserInfo' AND id = object_id(N'dbo.ConnectionLog')) 
    alter table dbo.ConnectionLog add constraint FK_ConnectionLog_UserInfoID foreign key (UserInfoID) references dbo.UserAccount(ID);