if exists (select * from Relations where RelationTable='Free and occupied beds' and Colname='NumPeople') then update Relations set BGColName = 'Настанени' where RelationTable='Free and occupied beds' and Colname='NumPeople' end if; GO if exists (select * from Relations where RelationTable='Free and occupied beds for period' and Colname='Students') then update Relations set BGColName = 'Настанени' where RelationTable='Free and occupied beds for period' and Colname='Students' end if;