


declare @comando  nvarchar(1000)
declare @constraint as varchar(100)
if  EXISTS (SELECT * FROM dbo.sysobjects WHERE  parent_obj = OBJECT_ID('equ_detallealquiler')  and name like 'DF__equ_detal__horom%')
BEGIN
SELECT @constraint =name FROM dbo.sysobjects WHERE  parent_obj = OBJECT_ID('equ_detallealquiler') and name like 'DF__equ_detal__horom%'
set @comando='ALTER TABLE [dbo].[equ_detallealquiler] DROP CONSTRAINT ' +@constraint 
exec(@comando)
END

if exists ( select * FROM INFORMATION_SCHEMA.COLUMNS  where Table_Name='equ_detallealquiler' and column_name = 'horometro')
begin
alter table [equ_detallealquiler] drop column  [horometro]
end 


