
IF  EXISTS (	SELECT *
				  FROM INFORMATION_SCHEMA.COLUMNS 
				 WHERE TABLE_NAME = 'EST_PED_VD'
				   AND COLUMN_NAME = 'END_DESTINATARIO'
				   and CHARACTER_MAXIMUM_LENGTH = 100
			   )

BEGIN 
 ALTER TABLE EST_PED_VD ALTER COLUMN END_DESTINATARIO       VARCHAR(1200)  collate SQL_Latin1_General_CP1_CI_AS;  
END;

go 

IF  EXISTS (	SELECT *
				  FROM INFORMATION_SCHEMA.COLUMNS 
				 WHERE TABLE_NAME = 'EST_PED_VD'
				   AND COLUMN_NAME = 'PONTO_REF_DESTINATARIO'
				   and CHARACTER_MAXIMUM_LENGTH = 150
			   )

BEGIN
 ALTER TABLE EST_PED_VD ALTER COLUMN PONTO_REF_DESTINATARIO VARCHAR(1200)  collate SQL_Latin1_General_CP1_CI_AS;   
END

go

IF  EXISTS (	SELECT *
				  FROM INFORMATION_SCHEMA.COLUMNS 
				 WHERE TABLE_NAME = 'EST_PED_VD'
				   AND COLUMN_NAME = 'ENDE_TRANSP'
				   and CHARACTER_MAXIMUM_LENGTH = 110
			   )

BEGIN
 ALTER TABLE EST_PED_VD ALTER COLUMN ENDE_TRANSP            VARCHAR(1200)  collate SQL_Latin1_General_CP1_CI_AS;   
 END