IF NOT EXISTS(SELECT 1 FROM syscolumns WHERE ID = OBJECT_ID('EST_PROD_BALAN_EST_PED_VD') AND NAME = 'TIPO_TRANSACAO')
begin  
	ALTER TABLE dbo.EST_PROD_BALAN_EST_PED_VD ADD
		TIPO_TRANSACAO int NULL

	ALTER TABLE dbo.EST_PROD_BALAN_EST_PED_VD ADD CONSTRAINT
		DF_EST_PROD_BALAN_EST_PED_VD_TIPO_TRANSACAO DEFAULT 0 FOR TIPO_TRANSACAO
end