if exists (select * from sys.foreign_keys where object_id = OBJECT_ID(N'FK_ConnectionLog_UserInfoID') AND parent_object_id = OBJECT_ID(N'dbo.ConnectionLog '))
    alter table dbo.ConnectionLog drop constraint FK_ConnectionLog_UserInfoID