declare @table_name nvarchar(50)
declare @strSQL nvarchar(1024)

set @table_name=N'ConsumingObjectConsumers'
set @strSQL=''
select @strSQL = @strSQL + ' ALTER TABLE ' + @table_name + ' DROP CONSTRAINT '+ object_name(FK_Tab.id) 
from sysobjects FK_Tab 
where xtype = 'F' AND object_id(@table_name)=parent_obj 

if @strSQL<>''  exec (@strSQL)
GO
alter table ConsumingObjectConsumers
	add foreign key(ConsumingObjectID)
	references ConsumingObjects(ID) 
        ON DELETE CASCADE

alter table ConsumingObjectConsumers
	add foreign key(ConsumerID)
	references Потребитель (Код_потребителя)
        ON DELETE CASCADE
GO
INSERT INTO FloatConsts(Description, Name, Value) VALUES('ПИР (для инвестпрограммы)', 'PIR', '18')
GO