DECLARE @dropDefault nvarchar(max);

SELECT 
	@dropDefault = STUFF((
select  'ALTER TABLE AKUZ.' + t.name + ' DROP CONSTRAINT ' + dc.name + ' '
from sys.default_constraints dc
join sys.tables t on t.object_id = dc.parent_object_id
where t.name in ('T_IHE_CLINICALDOCUMENT_EVENT') and dc.type_desc = 'DEFAULT_CONSTRAINT'
FOR XML PATH(''), TYPE).value('.', 'varchar(max)'), 1, 0, ' ')

if(@dropDefault is not null)
begin
	EXEC sp_executesql @dropDefault;
end



