SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/*
EXEC USP_MANTTO_INDEX
  @IsMaintenanceDay  = 0, 
  @FragmentationRate  = 15.0,
  @ReuildOnFragmentation = 30.0, 
  @PageCount    = 128, 
  @ExecutionMode   = 2
*/
ALTER PROCEDURE [dbo].[USP_MANTTO_INDEX]
(
 
 @IsMaintenanceDay  BIT  = 0, -- 1) Dia de mantenimiento, 0) No es dia de mantenimiento
 @FragmentationRate  FLOAT = 15.0, -- Tasa máxima de fragmentación permitida antes de una reorganización
 @ReuildOnFragmentation FLOAT = 30.0, -- Tasa máxima de fragmentación permitida antes de una reconstrucción
 @PageCount    INT  = 128, -- Número máximo de paginas que son usadas por el indice antes de ameritar mantenimiento
 @ExecutionMode   INT  = 1  -- 0) Modo callado, 1) Modo detallado, 2) Solo consulta
)
AS
BEGIN
/**********************************************************************
PROCEDIMIENTO:  USP_MANTTO_INDEX
PARAMETROS
 @IsMaintenanceDay  BIT  = 0, -- 1) Dia de mantenimiento, 0) No es dia de mantenimiento
 @FragmentationRate  FLOAT = 15.0, -- Tasa máxima de fragmentación permitida antes de una reorganización
 @ReuildOnFragmentation FLOAT = 30.0, -- Tasa máxima de fragmentación permitida antes de una reconstrucción
 @PageCount    INT  = 128, -- Número máximo de paginas que son usadas por el indice antes de ameritar mantenimiento
 @ExecutionMode     INT  = 1  -- 0) Modo callado, 1) Modo detallado
***********************************************************************/
 DECLARE  @TableName  NVARCHAR(255), -- Nombre de la tabla a la que se le asocia el índice
    @IndexName  NVARCHAR(255), -- Nombre del índice que se esta evaluando
    @Fragmentation FLOAT,   -- Tasa de fragmentación del índice
    @Pages   INT,   -- Cantidad de páginas usadas por el índice
    @SQLStm   NVARCHAR(1024) -- Cadena de ejecución dinámica
 
 
 -- Validación los valores por defecto de los parámetros del proceso
 SET @ReuildOnFragmentation = ISNULL(@ReuildOnFragmentation,30.0)
 SET @PageCount    = ISNULL(@PageCount,128)
 SET @FragmentationRate  = ISNULL(@FragmentationRate,15.0)
 SET @IsMaintenanceDay  = ISNULL(@IsMaintenanceDay,0)
 SET @ExecutionMode     = ISNULL(@ExecutionMode,1)
 BEGIN TRY
  IF @ExecutionMode = 2
  BEGIN
   SELECT
    OBJECT_SCHEMA_NAME(FRAG.[object_id]) +
    '.' + OBJECT_NAME(FRAG.[object_id])
              TableName,
    SIX.[name]        IndexName,
    FRAG.avg_fragmentation_in_percent  Fragmentation,
    FRAG.page_count       Pages
   FROM
    sys.dm_db_index_physical_stats
    (
     DB_ID(),    --obtiene y utiliza la BD a la que la sesion actual pertenzca
     0,          --parametro del object_id.
     DEFAULT,    --parametro del index_id.
     0,          --parametro del del número de la partición.
     DEFAULT     --modo de scaneo. por defcto "LIMITED", el cual es el recomendado
    ) FRAG
    JOIN
    sys.indexes SIX ON FRAG.[object_id] = SIX.[object_id] AND FRAG.index_id = SIX.index_id
   WHERE
    --discriminación de los HEAP's.
    FRAG.index_type_desc <> 'HEAP' AND
    (
    --Considerar solo los indices que requieren mantenimiento, de acuerdo a los parametros
    (FRAG.page_count > @PageCount AND FRAG.avg_fragmentation_in_percent > @FragmentationRate)
    OR
    --o todos en caso de mantenimiento
    @IsMaintenanceDay = 1
    )
   ORDER BY
    FRAG.avg_fragmentation_in_percent DESC;
  
  END
  ELSE
  BEGIN
   DECLARE cur_mantain_index CURSOR FAST_FORWARD FOR
   SELECT
    OBJECT_SCHEMA_NAME(FRAG.[object_id]) +
    '.' + OBJECT_NAME(FRAG.[object_id])
              TableName,
    SIX.[name]        IndexName,
    FRAG.avg_fragmentation_in_percent  Fragmentation,
    FRAG.page_count       Pages
   FROM
    sys.dm_db_index_physical_stats
    (
     DB_ID(),    --obtiene y utiliza la BD a la que la sesion actual pertenzca
     0,          --parametro del object_id.
     DEFAULT,    --parametro del index_id.
     0,          --parametro del del número de la partición.
     DEFAULT     --modo de scaneo. por defcto "LIMITED", el cual es el recomendado
    ) FRAG
    JOIN
    sys.indexes SIX ON FRAG.[object_id] = SIX.[object_id] AND FRAG.index_id = SIX.index_id
   WHERE
    --discriminación de los HEAP's.
    FRAG.index_type_desc <> 'HEAP' AND
    (
    --Considerar solo los indices que requieren mantenimiento, de acuerdo a los parametros
    (FRAG.page_count > @PageCount AND FRAG.avg_fragmentation_in_percent > @FragmentationRate)
    OR
    --o todos en caso de mantenimiento
    @IsMaintenanceDay = 1
    )
   ORDER BY
    FRAG.avg_fragmentation_in_percent DESC;
      
      
   OPEN cur_mantain_index;
   FETCH FROM cur_mantain_index INTO
      @TableName  ,
      @IndexName  ,
      @Fragmentation ,
      @Pages   
     
   WHILE @@FETCH_STATUS = 0
   BEGIN
    
    
    
    -- Validación de la condición para la reconstrucción del índice
    IF  @Fragmentation > @ReuildOnFragmentation
    BEGIN   
     IF @ExecutionMode = 1 -- Modo detallado
     BEGIN
      PRINT 'Reconstruyendo el indice ' + @IndexName +' porque su tasa de fragmentación es '+ltrim(rtrim(str(@ReuildOnFragmentation))) + ' y ha excedido el limite establecido en ' + ltrim(rtrim(str(@Fragmentation)))         
     END
    
     -- Armado de la instrucción para la reconstrucción del indice
     SET @SQLStm = 'ALTER INDEX '+ @IndexName + ' ON ' + @TableName + ' REBUILD ; '
    
     -- Ejecución de la instrucción de reconstrucción
     EXEC (@SQLStm)
     
    END
    ELSE
    BEGIN
    
     IF @ExecutionMode = 1 -- Modo detallado
     BEGIN
      -- Informar la causa del mantenimiento
      IF @IsMaintenanceDay = 1
      BEGIN
       PRINT 'Reoganizando indice ' + @IndexName +' porque es dia de mantenimiento.'        
      END
      ELSE
      BEGIN
       PRINT 'Reoganizando indice ' + @IndexName +' porque su tasa de fragmentación es '+ ltrim(rtrim(str(@FragmentationRate))) +' y ha excedido el limite establecido en '+ ltrim(rtrim(str(@Fragmentation)))
      END
     END
        
     -- Armado de la instrucción para la reoganización del indice
     SET @SQLStm = 'ALTER INDEX '+ @IndexName + ' ON '  + @TableName  + '  REORGANIZE; '
     
     -- Ejecución de la instrucción de reorganización
     EXEC (@SQLStm)
     
    END
   
    FETCH FROM cur_mantain_index INTO
      @TableName  ,
      @IndexName  ,
      @Fragmentation ,
      @Pages   
   END
   CLOSE cur_mantain_index;
   DEALLOCATE cur_mantain_index;
  END
 END TRY
 BEGIN CATCH
  
  IF CURSOR_STATUS('global','cur_mantain_index') >=0
  BEGIN
   CLOSE cur_mantain_index
   DEALLOCATE cur_mantain_index
  END
  
  SELECT
   ERROR_NUMBER()  AS ErrorNumber
   ,ERROR_SEVERITY() AS ErrorSeverity
   ,ERROR_STATE()  AS ErrorState
   ,ERROR_PROCEDURE() AS ErrorProcedure
   ,ERROR_LINE()  AS ErrorLine
   ,ERROR_MESSAGE() AS ErrorMessage;
        
    
    
 END CATCH
END
domingo, 29 de junio de 2014
Using the autocompleteextender over a popupextender or any other control with z-index property greater than zero.
This issue can be fixed easily using a little of CSS Code we need to define 3 CSS clases one for the CompletionListCssClass property of the extender, one more for the CompletionListItemCssClass and the last one for the CompletionListHighlightedCssClass attribute.
******************** Autocomplete extender control *******************************
CompletionListCssClass="autocomplete_completionListElement" CompletionListItemCssClass="autocomplete_listItem" CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem"
*********************** CSS *********************************
    /* AutoComplete highlighted item */
    .autocomplete_completionListElement
    {
        margin: 0px !important;
        z-index:99999 !important;
        background-color: ivory;
        color: windowtext;
        border: buttonshadow;
        border-width: 1px;
        border-style: solid;
        cursor: 'default';
        overflow: auto;
        height: 200px;
        text-align: left;
        left: 0px;
        list-style-type: none;
    }
    /* AutoComplete highlighted item */
    .autocomplete_highlightedListItem
    {
        z-index:99999 !important;
        background-color: #ffff99;
        color: black;
        padding: 1px;
        cursor:hand;
    }
    /* AutoComplete item */
    .autocomplete_listItem
    {
        z-index:99999 !important;
        background-color: window;
        color: windowtext;
        padding: 1px;
        cursor:hand;
    }
Suscribirse a:
Comentarios (Atom)
Transacciones Fiori
/UI2/CACHE Register service for UI2 cache use /UI2/CACHE_DEL Delete cache entries /UI2/CHIP Chip Registration /UI2/CUST Customizing of UI ...
- 
Sobre todo en ambientes Industriales es muy socorrido el uso de impresoras Zebra, en seguida el código fuente, la siguiente clase implement...
- 
Un WOEID es un identificador único de lugares en la tierra por sus siglas (Where On Earth IDentifier), fue introducido por Yahoo para identi...
