--PARA PERFIL 
IF NOT EXISTS(SELECT *FROM [dbo].[_columnas] WHERE[tabla]='seg_perfil'
      AND [columna]='paraCliente'AND[mostrarEnGrilla]=1 AND[ordenGrilla]=5AND[requerido]=1 AND[tipo]='bit'AND[defecto]=0 AND [tamano] IS NULL)
BEGIN
INSERT INTO [dbo].[_columnas]
([tabla] ,[columna] ,[mostrarEnGrilla],[ordenGrilla],[requerido] ,[tipo],[defecto],[tamano])
 VALUES
 ('seg_perfil' ,'paraCliente',1 ,5 ,1 ,'bit' ,0 ,null)
END

IF NOT EXISTS(SELECT * FROM [dbo].[_columnas] WHERE[tabla]='seg_perfil'
 AND [columna]='paraProveedor'AND[mostrarEnGrilla]=1 AND[ordenGrilla]=6 AND[requerido]=1 AND[tipo]='bit'AND[defecto]=0 AND [tamano] IS NULL)
 BEGIN
INSERT INTO [dbo].[_columnas]
([tabla] ,[columna] ,[mostrarEnGrilla],[ordenGrilla],[requerido] ,[tipo],[defecto],[tamano])
 VALUES('seg_perfil' ,'paraProveedor',1 ,6 ,1 ,'bit' ,0 ,null)
END


--PARA DIS_OBRA_CATALOGO

IF NOT EXISTS(SELECT *FROM [dbo].[_columnas] WHERE[tabla]='dis_obra_catalogo'
      AND [columna]='valorMinimo'AND[mostrarEnGrilla]=1 AND[ordenGrilla]=5 AND[requerido]=1 AND[tipo]='float'AND[defecto]=0 AND [tamano] IS NULL)
BEGIN
INSERT INTO [dbo].[_columnas]
([tabla] ,[columna] ,[mostrarEnGrilla],[ordenGrilla],[requerido] ,[tipo],[defecto],[tamano])
 VALUES('dis_obra_catalogo' ,'valorMinimo',1 ,5 ,1 ,'float' ,0 ,null)
END

IF NOT EXISTS(SELECT * FROM [dbo].[_columnas] WHERE[tabla]='dis_obra_catalogo'
 AND [columna]='valorMaximo'AND[mostrarEnGrilla]=1 AND[ordenGrilla]=6 AND[requerido]=1 AND[tipo]='float'AND[defecto]=0 AND [tamano] IS NULL)
 BEGIN
INSERT INTO [dbo].[_columnas]([tabla] ,[columna] ,[mostrarEnGrilla],[ordenGrilla],[requerido] ,[tipo],[defecto],[tamano])
 VALUES('dis_obra_catalogo' ,'valorMaximo',1 ,6 ,1 ,'float' ,0 ,null)
END
