if not exists (select 1 FROM _columnas where tabla = 'syn_sistemaIntegrar' and columna = 'id')
begin  
INSERT INTO [dbo].[_columnas]
           ([tabla]
           ,[columna]
           ,[mostrarEnGrilla]
           ,[ordenGrilla]
           ,[requerido]
           ,[tipo]
           ,[defecto]
           ,[tamano]
		   ,[id_seccionAtributo]
           ,[mostrarEnAPI]
           ,[dependiente])
     VALUES
           ('syn_sistemaIntegrar'
           ,'id'
           ,1
           ,1
           ,1
           ,'int'
           ,NULL
           ,NULL
		   ,0
		   ,0
		   ,NULL)
end

if not exists (select 1 FROM _columnas where tabla = 'syn_sistemaIntegrar' and columna = 'uid')
begin  
INSERT INTO [dbo].[_columnas]
           ([tabla]
           ,[columna]
           ,[mostrarEnGrilla]
           ,[ordenGrilla]
           ,[requerido]
           ,[tipo]
           ,[defecto]
           ,[tamano]
		   ,[id_seccionAtributo]
           ,[mostrarEnAPI]
           ,[dependiente])
     VALUES
           ('syn_sistemaIntegrar'
           ,'uid'
           ,1
           ,1
           ,1
           ,'varchar'
           ,NULL
           ,500
		   ,0
		   ,0
		   ,NULL)
end

if not exists (select 1 FROM _columnas where tabla = 'syn_sistemaIntegrar' and columna = 'eid')
begin  
INSERT INTO [dbo].[_columnas]
           ([tabla]
           ,[columna]
           ,[mostrarEnGrilla]
           ,[ordenGrilla]
           ,[requerido]
           ,[tipo]
           ,[defecto]
           ,[tamano]
		   ,[id_seccionAtributo]
           ,[mostrarEnAPI]
           ,[dependiente])
     VALUES
           ('syn_sistemaIntegrar'
           ,'eid'
           ,1
           ,1
           ,1
           ,'varchar'
           ,NULL
           ,50
		   ,0
		   ,0
		   ,NULL)
end

if not exists (select 1 FROM _columnas where tabla = 'syn_sistemaIntegrar' and columna = 'id_usuario_modifico')
begin  
INSERT INTO [dbo].[_columnas]
           ([tabla]
           ,[columna]
           ,[mostrarEnGrilla]
           ,[ordenGrilla]
           ,[requerido]
           ,[tipo]
           ,[defecto]
           ,[tamano]
		   ,[id_seccionAtributo]
           ,[mostrarEnAPI]
           ,[dependiente])
     VALUES
           ('syn_sistemaIntegrar'
           ,'id_usuario_modifico'
           ,1
           ,1
           ,1
           ,'int'
           ,'((0))'
           ,NULL
		   ,0
		   ,0
		   ,NULL)
end

if not exists (select 1 FROM _columnas where tabla = 'syn_sistemaIntegrar' and columna = 'id_usuario_creo')
begin  
INSERT INTO [dbo].[_columnas]
           ([tabla]
           ,[columna]
           ,[mostrarEnGrilla]
           ,[ordenGrilla]
           ,[requerido]
           ,[tipo]
           ,[defecto]
           ,[tamano]
		   ,[id_seccionAtributo]
           ,[mostrarEnAPI]
           ,[dependiente])
     VALUES
           ('syn_sistemaIntegrar'
           ,'id_usuario_creo'
           ,1
           ,1
           ,1
           ,'int'
           ,'((0))'
           ,NULL
		   ,0
		   ,0
		   ,NULL)
end

if not exists (select 1 FROM _columnas where tabla = 'syn_sistemaIntegrar' and columna = 'fechaModificacion')
begin  
INSERT INTO [dbo].[_columnas]
           ([tabla]
           ,[columna]
           ,[mostrarEnGrilla]
           ,[ordenGrilla]
           ,[requerido]
           ,[tipo]
           ,[defecto]
           ,[tamano]
		   ,[id_seccionAtributo]
           ,[mostrarEnAPI]
           ,[dependiente])
     VALUES
           ('syn_sistemaIntegrar'
           ,'fechaModificacion'
           ,0
           ,0
           ,1
           ,'smalldatetime'
           ,'(getdate())'
           ,NULL
		   ,0
		   ,0
		   ,NULL)
end

if not exists (select 1 FROM _columnas where tabla = 'syn_sistemaIntegrar' and columna = 'fechaCreacion')
begin  
INSERT INTO [dbo].[_columnas]
           ([tabla]
           ,[columna]
           ,[mostrarEnGrilla]
           ,[ordenGrilla]
           ,[requerido]
           ,[tipo]
           ,[defecto]
           ,[tamano]
		   ,[id_seccionAtributo]
           ,[mostrarEnAPI]
           ,[dependiente])
     VALUES
           ('syn_sistemaIntegrar'
           ,'fechaCreacion'
           ,0
           ,0
           ,1
           ,'smalldatetime'
           ,'(getdate())'
           ,NULL
		   ,0
		   ,0
		   ,NULL)
end

if not exists (select 1 FROM _columnas where tabla = 'syn_sistemaIntegrar' and columna = 'active')
begin  
INSERT INTO [dbo].[_columnas]
           ([tabla]
           ,[columna]
           ,[mostrarEnGrilla]
           ,[ordenGrilla]
           ,[requerido]
           ,[tipo]
           ,[defecto]
           ,[tamano]
		   ,[id_seccionAtributo]
           ,[mostrarEnAPI]
           ,[dependiente])
     VALUES
           ('syn_sistemaIntegrar'
           ,'active'
           ,1
           ,1
           ,1
           ,'bit'
           ,'((1))'
           ,NULL
		   ,0
		   ,0
		   ,NULL)
end

if not exists (select 1 FROM _columnas where tabla = 'syn_sistemaIntegrar' and columna = 'sistemaIntegrar')
begin  
INSERT INTO [dbo].[_columnas]
           ([tabla]
           ,[columna]
           ,[mostrarEnGrilla]
           ,[ordenGrilla]
           ,[requerido]
           ,[tipo]
           ,[defecto]
           ,[tamano]
		   ,[id_seccionAtributo]
           ,[mostrarEnAPI]
           ,[dependiente])
     VALUES
           ('syn_sistemaIntegrar'
           ,'sistemaIntegrar'
           ,1
           ,1
           ,1
           ,'varchar'
           ,'('''')'
           ,200
		   ,0
		   ,1
		   ,NULL)
end

if not exists (select 1 FROM _columnas where tabla = 'syn_sistemaIntegrar' and columna = 'sistemaIntegrar_codigo')
begin  
INSERT INTO [dbo].[_columnas]
           ([tabla]
           ,[columna]
           ,[mostrarEnGrilla]
           ,[ordenGrilla]
           ,[requerido]
           ,[tipo]
           ,[defecto]
           ,[tamano]
		   ,[id_seccionAtributo]
           ,[mostrarEnAPI]
           ,[dependiente])
     VALUES
           ('syn_sistemaIntegrar'
           ,'sistemaIntegrar_codigo'
           ,1
           ,1
           ,0
           ,'varchar'
           ,'('''')'
           ,200
		   ,0
		   ,1
		   ,NULL)
end

if not exists (select 1 FROM _columnas where tabla = 'syn_sistemaIntegrar' and columna = 'usuario')
begin  
INSERT INTO [dbo].[_columnas]
           ([tabla]
           ,[columna]
           ,[mostrarEnGrilla]
           ,[ordenGrilla]
           ,[requerido]
           ,[tipo]
           ,[defecto]
           ,[tamano]
		   ,[id_seccionAtributo]
           ,[mostrarEnAPI]
           ,[dependiente])
     VALUES
           ('syn_sistemaIntegrar'
           ,'usuario'
           ,1
           ,1
           ,0
           ,'varchar'
           ,'('''')'
           ,200
		   ,0
		   ,1
		   ,NULL)
end

if not exists (select 1 FROM _columnas where tabla = 'syn_sistemaIntegrar' and columna = 'clave')
begin  
INSERT INTO [dbo].[_columnas]
           ([tabla]
           ,[columna]
           ,[mostrarEnGrilla]
           ,[ordenGrilla]
           ,[requerido]
           ,[tipo]
           ,[defecto]
           ,[tamano]
		   ,[id_seccionAtributo]
           ,[mostrarEnAPI]
           ,[dependiente])
     VALUES
           ('syn_sistemaIntegrar'
           ,'clave'
           ,1
           ,1
           ,0
           ,'varchar'
           ,'('''')'
           ,200
		   ,0
		   ,1
		   ,NULL)
end
