if exists(select * from sys.syscolumns where name = 'ConnectionID' and id = object_id(N'dbo.ConnectionState') and isnullable = 0)
    alter table dbo.ConnectionState alter column ConnectionID uniqueidentifier null;

if exists(select * from sys.syscolumns where name = 'RepositoryID' and id = object_id(N'dbo.ConnectionState') and isnullable = 0)
    alter table dbo.ConnectionState alter column RepositoryID uniqueidentifier null;

if exists(select * from sys.syscolumns where name = 'UserID' and id = object_id(N'dbo.ConnectionState') and isnullable = 0)
    alter table dbo.ConnectionState alter column UserID uniqueidentifier null;