if not exists(select * from Relations where RelationTable = 'Rent Information' and ColName = 'Subsidy') then insert into "Relations" ("TableName", "ColName", "BGTableName", "BGColName", "RelationTable", "RelationCol", "SelectCol", "N", "Function", "Suma", "Mask", "Align", "Sortirane", "Zadaljitelna", "Promenliva", "FilterList", "DftFilter", "Shirina", "Opisanie", "DftLike", "AutoStretch", "Spravka", "PoslData") values('#OwePaidRentForMonth', 'Subsidy', 'Дължим и платен наем', 'Субсидия', 'Rent Information', 'Subsidy', 2, GetFreeNInRelations('Rent Information',null,null,2), 'SUM(Subsidy)', 'Sum(qrData.Субсидия)', '0.00', 0, 0, '', '', '', '', 90, '', 0, 0, 1, '29.01.2024'); end if; GO