delete pci
from IES.T_PLAN_CUT_ITEM pci
    join IES.T_SCHET_ITEM_FAKT sif on sif.SchetItemFaktID = pci.SchetItemFakt
where sif.ObjectID is null
GO

delete sif
from IES.T_SCHET_ITEM_FAKT sif
where sif.ObjectID is null
GO

exec dbo.sp_AlterDropColumn '[IES].[T_SCHET_ITEM_FAKT]' , 'ObjectID', 1, 'uniqueidentifier NOT NULL'
GO

