if not exists (select column_name FROM INFORMATION_SCHEMA.COLUMNS where Table_Name='syn_campoIntegracion'  and column_name = 'campoLocal' )
begin  
	alter table [syn_campoIntegracion] add [campoLocal] varchar(200) NULL DEFAULT ''
end
go

if not exists (select column_name FROM INFORMATION_SCHEMA.COLUMNS where Table_Name='syn_campoIntegracion'  and column_name = 'tablaAuxiliar' )
begin  
	alter table [syn_campoIntegracion] add [tablaAuxiliar] varchar(200) NULL DEFAULT ''
end
go

if not exists (select column_name FROM INFORMATION_SCHEMA.COLUMNS where Table_Name='syn_campoIntegracion'  and column_name = 'campoEnlace' )
begin  
	alter table [syn_campoIntegracion] add [campoEnlace] varchar(300) NULL DEFAULT ''
end
go

if not exists (select column_name FROM INFORMATION_SCHEMA.COLUMNS where Table_Name='syn_campoIntegracion'  and column_name = 'valorXDefecto' )
begin  
	alter table [syn_campoIntegracion] add [valorXDefecto] varchar(200) NULL DEFAULT ''
end
go

if not exists (select column_name FROM INFORMATION_SCHEMA.COLUMNS where Table_Name='syn_campoIntegracion'  and column_name = 'tipoDato' )
begin  
	alter table [syn_campoIntegracion] add [tipoDato] int NULL DEFAULT 0
end
go

if not exists (select column_name FROM INFORMATION_SCHEMA.COLUMNS where Table_Name='syn_campoIntegracion'  and column_name = 'longitud' )
begin  
	alter table [syn_campoIntegracion] add [longitud] int NULL DEFAULT 0
end
go

if not exists (select column_name FROM INFORMATION_SCHEMA.COLUMNS where Table_Name='syn_campoIntegracion'  and column_name = 'esLlave' )
begin  
	alter table [syn_campoIntegracion] add [esLlave] bit NULL DEFAULT 0
end
go

if not exists (select column_name FROM INFORMATION_SCHEMA.COLUMNS where Table_Name='syn_campoIntegracion'  and column_name = 'orden' )
begin  
	alter table [syn_campoIntegracion] add [orden] int NULL DEFAULT 0
end
go

if not exists (select column_name FROM INFORMATION_SCHEMA.COLUMNS where Table_Name='syn_campoIntegracion'  and column_name = 'id_puntoIntegracion' )
begin  
	alter table [syn_campoIntegracion] add [id_puntoIntegracion] int NULL DEFAULT 0 FOREIGN KEY (id_puntoIntegracion) REFERENCES syn_puntoIntegracion(id)
end
go
