DECLARE @restriccion NVARCHAR(200)
DECLARE @comando NVARCHAR (1000)
SELECT @restriccion = NAME FROM sys.objects WHERE parent_object_id in (SELECT object_id FROM sys.objects WHERE NAME like 'ort_reporteTecnico') and NAME like 'DF__ort_repor__id_do__%'
IF exists (SELECT * FROM sys.objects WHERE NAME=@restriccion)
BEGIN
--Deshabilitar restricción
SET @comando = N'ALTER TABLE [ort_reporteTecnico] DROP CONSTRAINT ' + @restriccion
EXECUTE sp_executesql @comando
--Eliminar CONSTRAINT de la llave foranea
ALTER TABLE [ort_reporteTecnico] DROP CONSTRAINT [FK_ort_reporteTecnico_id_documento_ot]
--Eliminar Columna
ALTER TABLE [ort_reporteTecnico] DROP COLUMN [id_documento.ot]
END

DELETE FROM _columnas WHERE tabla='ort_reporteTecnico' and columna = 'id_documento.ot'