if not exists (select * FROM INFORMATION_SCHEMA.COLUMNS where Table_Name='gen_registroEnvio'  and column_name = 'tabla' )
begin  
alter table [gen_registroEnvio] add [tabla] varchar(200) NOT NULL DEFAULT ''
end

go

if not exists (select * FROM INFORMATION_SCHEMA.COLUMNS where Table_Name='gen_registroEnvio'  and column_name = 'reintentar' )
begin 
alter table [gen_registroEnvio] add [reintentar] bit NOT NULL DEFAULT 0 
end

go

if not exists (select * FROM INFORMATION_SCHEMA.COLUMNS where Table_Name='gen_registroEnvio'  and column_name = 'id_envioCorreo' )
begin 
alter table [gen_registroEnvio] add [id_envioCorreo] int NOT NULL DEFAULT 0  FOREIGN KEY (id_envioCorreo) REFERENCES gen_envioCorreo(id)
end

go

if not exists (select * FROM INFORMATION_SCHEMA.COLUMNS where Table_Name='gen_registroEnvio'  and column_name = 'id_registroEnvio' )
begin 
alter table [gen_registroEnvio] add [id_registroEnvio] int NOT NULL DEFAULT 0  FOREIGN KEY (id_registroEnvio) REFERENCES gen_registroEnvio(id)
end

go


if not exists (select * FROM INFORMATION_SCHEMA.COLUMNS where Table_Name='gen_detalleRegistroEnvio'  and column_name = 'email' )
begin  
alter table [gen_detalleRegistroEnvio] add [email] varchar(200) NOT NULL DEFAULT ''
end

go

if not exists (select * FROM INFORMATION_SCHEMA.COLUMNS where Table_Name='gen_detalleRegistroEnvio'  and column_name = 'enviado' )
begin 
alter table [gen_detalleRegistroEnvio] add [enviado] bit NOT NULL DEFAULT 0 
end

go

if not exists (select * FROM INFORMATION_SCHEMA.COLUMNS where Table_Name='gen_detalleRegistroEnvio'  and column_name = 'enviar' )
begin 
alter table [gen_detalleRegistroEnvio] add [enviar] bit NOT NULL DEFAULT 0 
end

go

if not exists (select * FROM INFORMATION_SCHEMA.COLUMNS where Table_Name='gen_detalleRegistroEnvio'  and column_name = 'idObjeto' )
begin 
alter table [gen_detalleRegistroEnvio] add [idObjeto] int NOT NULL DEFAULT 0 
end

go

if not exists (select * FROM INFORMATION_SCHEMA.COLUMNS where Table_Name='gen_detalleRegistroEnvio'  and column_name = 'id_registroEnvio' )
begin 
alter table [gen_detalleRegistroEnvio] add [id_registroEnvio] int NOT NULL DEFAULT 0  FOREIGN KEY (id_registroEnvio) REFERENCES gen_registroEnvio(id)
end