if not exists (SELECT * FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE CONSTRAINT_TYPE = 'PRIMARY KEY' AND TABLE_NAME = 'Connections') 
BEGIN
  alter table dbo.Connections ALTER COLUMN ID uniqueidentifier not null;
  alter table dbo.Connections ADD CONSTRAINT PK_ID PRIMARY KEY (ID);
END