IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

MS SQL Server Discussion :

Réindexation - sql serveur 2000.


Sujet :

MS SQL Server

  1. #1
    Membre expérimenté

    Profil pro
    Inscrit en
    Août 2002
    Messages
    1 249
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2002
    Messages : 1 249
    Points : 1 745
    Points
    1 745
    Par défaut Réindexation - sql serveur 2000.
    Bonjour,

    Nous avons un site Aloes, dont certaines requêtes sql dépassent le time out de la base.

    1 - Existe t'il une méthode pour augmenter le time-out entre asp.net et sql serveur ? Cela dépannerait dans un premier temps, nous sommes tenus de répondre au plus vite.

    Je me suis proposé d'optimiser la requête afin qu'elle rentre dans le time out. :o))
    2 - Comme aucune réindexation n'a été effectué sur le serveur de production, je me suis proposé de lancer celle ci.
    Sur sql serveur 2005, il existe un plan de maintenance avec la fonction réindexer la base. Sur Sql serveur 2000, comment procéder-vous pour réindexer la totalité d'une base ?

    3 - Aprés la réindexation, je dois vérifier que l'ensemble des index de la requêtes sont bon pour réduire encore le temps de chargement. On verra ca apres...

    A+

  2. #2
    Membre expérimenté

    Profil pro
    Inscrit en
    Août 2002
    Messages
    1 249
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2002
    Messages : 1 249
    Points : 1 745
    Points
    1 745
    Par défaut indexation sql serveur 2000
    1 - Existe t'il une méthode pour augmenter le time-out entre asp.net et sql serveur ? Cela dépannerait dans un premier temps, nous sommes tenus de répondre au plus vite.

    2 - réindexation
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
     
    USE aloes
    go
    DECLARE @TableName varchar(255)
    DECLARE TableCursor CURSOR FORSELECT table_name FROM information_schema.tablesWHERE table_type = 'base table'
    OPEN TableCursor
    FETCH NEXT FROM TableCursor INTO @TableName
    WHILE @@FETCH_STATUS = 0
    BEGIN
    DBCC DBREINDEX(@TableName,' ',90)FETCH NEXT FROM TableCursor INTO @TableName
    END
    CLOSE TableCursor
    DEALLOCATE TableCursor
    go
    Exemple de requête à optimiser : 35 secondes.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    declare @id_culture bigint
    declare @id_pays bigint
    declare @date_debut datetime
    declare @date_fin datetime
    set @id_culture = 2 
    set @id_pays = 1 
    set @date_debut ='01/01/2006'
    set @date_fin ='01/01/2007'
    select l.id_laboratoire,count(a.id_analyse)as nb_analyses 
    from fn_analyse_validee_datee_culture_multi(@id_culture) a innerjoin bulletin_analyse ba on a.id_bulletin = ba.id_bulletin 
    innerjoin laboratoire l on ba.id_laboratoire = l.id_laboratoire 
    innerjoin(selectdistinct id_analyse from partie_analyse where detection = 1) pa on a.id_analyse = pa.id_analyse where a.id_analyse notin(selectdistinct id_analyse from partie_analyse where qte_residu > dbo.fn_lmr_partie(id_partie, @id_pays))and date_reception between @date_debut and @date_fin 
    groupby l.id_laboratoire

  3. #3
    Membre éprouvé
    Homme Profil pro
    Consultant informatique
    Inscrit en
    Août 2006
    Messages
    730
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 62
    Localisation : France

    Informations professionnelles :
    Activité : Consultant informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Août 2006
    Messages : 730
    Points : 923
    Points
    923
    Par défaut
    essayes un truc dans ce style

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    declare @id_culture bigint
    declare @id_pays bigint
    declare @date_debut datetime
    declare @date_fin datetime
    set @id_culture = 2 
    set @id_pays = 1 
    set @date_debut ='01/01/2006'
    set @date_fin ='01/01/2007'
     
    create table #analyse_culture
    (id_analyse int)
     
    create index idx_an on #analyse_culture (id_analyse)
     
    insert into #analyse_culture
    select id_analyse from fn_analyse_validee_datee_culture_multi(@id_culture)
     
    create table #analyse_detection
    (id_analyse int)
     
    insert into #analyse_detection
    select distinct id_analyse from partie_analyse where detection = 1
     
    create index idx_cu on #analyse_detection (id_analyse)
     
    delete #analyse_detection a
    from partie_analyse b
    where 
    a.id_analyse=b.id_analyse
    and qte_residu > dbo.fn_lmr_partie(id_partie, @id_pays))
    and date_reception between @date_debut and @date_fin
     
    select l.id_laboratoire,count(a.id_analyse)as nb_analyses 
    from #analyse a 
    inner join bulletin_analyse ba on a.id_bulletin = ba.id_bulletin 
    inner join laboratoire l on ba.id_laboratoire = l.id_laboratoire 
    inner join #analyse_detection pa on a.id_analyse = pa.id_analyse 
    group by l.id_laboratoire

  4. #4
    Membre expérimenté

    Profil pro
    Inscrit en
    Août 2002
    Messages
    1 249
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2002
    Messages : 1 249
    Points : 1 745
    Points
    1 745
    Par défaut merci serge.
    salut,

    comme j'étais pressé de donner une réponse... le site buggue actuellement... j'ai modifié le timeout.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    Dim cmd As SqlCommand = SConnAloes.CreateCommand()
    cmd.CommandText = SqlAnalyseInfLMR
    cmd.CommandType = CommandType.Text
    cmd.CommandTimeout = 300000
    Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
    da.Fill(DTAnalyseInfLMR)
    Maintenant, je vais prendre le temps de réduire le temps de la requete.

  5. #5
    Membre expérimenté

    Profil pro
    Inscrit en
    Août 2002
    Messages
    1 249
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2002
    Messages : 1 249
    Points : 1 745
    Points
    1 745
    Par défaut sql.
    DELETE #analyse_detection a
    FROM partie_analyse b
    WHERE
    a
    .id_analyse=b.id_analyse
    AND qte_residu > dbo.fn_lmr_partie(id_partie, @id_pays))
    AND
    date_reception BETWEEN @date_debut AND @date_fin
    est ce possible ?

  6. #6
    Membre éprouvé
    Homme Profil pro
    Consultant informatique
    Inscrit en
    Août 2006
    Messages
    730
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 62
    Localisation : France

    Informations professionnelles :
    Activité : Consultant informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Août 2006
    Messages : 730
    Points : 923
    Points
    923
    Par défaut
    oui

  7. #7
    Membre expérimenté

    Profil pro
    Inscrit en
    Août 2002
    Messages
    1 249
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2002
    Messages : 1 249
    Points : 1 745
    Points
    1 745
    Par défaut Evolution.
    Cette requête : 34 secondes.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    declare @id_culture bigint
    declare @id_pays bigint
    declare @date_debut datetime
    declare @date_fin datetime
     
    SET @id_culture = 2 
    SET @id_pays = 1 
    SET @date_debut ='01/01/2006'
    SET @date_fin ='01/01/2007'
     
    DROPTABLE #analyse_detection
     
    CREATETABLE #analyse_detection(id_analyse bigint)
     
    INSERTINTO #analyse_detection
    SELECTDISTINCT id_analyse FROM partie_analyse WHERE detection = 1
     
    CREATEINDEX idx_cu ON #analyse_detection (id_analyse)
     
    DELETE #analyse_detection 
    FROM partie_analyse b
    WHERE
    #analyse_detection.id_analyse=b.id_analyse
    AND qte_residu > dbo.fn_lmr_partie(id_partie, @id_pays)
     
    SELECT l.id_laboratoire,count(a.id_analyse)AS nb_analyses 
    FROM dbo.fn_analyse_validee_datee_culture_multi(@id_culture) a 
    INNERJOIN bulletin_analyse ba ON a.id_bulletin = ba.id_bulletin 
    INNERJOIN laboratoire l ON ba.id_laboratoire = l.id_laboratoire 
    INNERJOIN #analyse_detection pa on a.id_analyse = pa.id_analyse 
    AND date_reception BETWEEN @date_debut AND @date_fin
    GROUPBY l.id_laboratoire
    La fonction dbo.fn_analyse_validee_datee_culture_multi(@id_culture) renvoie une table. J'ai dù modifié ton code.

    J'ai trouvé pourquoi la requete prend 34 secondes... La fonction dbo.fn_lmr_partie(id_partie, @id_pays) fait appel à une fonction qui fait appel à une grosse fonction...

    La requete ci dessous prend 34 secondes à cause de cela...
    DELETE #analyse_detection
    FROM partie_analyse b
    WHERE
    #analyse_detection.id_analyse=b.id_analyse
    AND qte_residu > dbo.fn_lmr_partie(id_partie, @id_pays)
    merci serge.

  8. #8
    Rédacteur

    Avatar de SQLpro
    Homme Profil pro
    Expert bases de données / SQL / MS SQL Server / Postgresql
    Inscrit en
    Mai 2002
    Messages
    21 848
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Var (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Expert bases de données / SQL / MS SQL Server / Postgresql
    Secteur : Conseil

    Informations forums :
    Inscription : Mai 2002
    Messages : 21 848
    Points : 52 966
    Points
    52 966
    Billets dans le blog
    6
    Par défaut
    Les fonctions renvoyant des tables ne peuvent pas être optimisées de manière simple. Essayer de les éradiquer : utilisez par exemple une vue.

    A +

  9. #9
    Membre chevronné

    Homme Profil pro
    Administrateur de base de données
    Inscrit en
    Août 2007
    Messages
    1 216
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : Suisse

    Informations professionnelles :
    Activité : Administrateur de base de données
    Secteur : Industrie Pharmaceutique

    Informations forums :
    Inscription : Août 2007
    Messages : 1 216
    Points : 1 758
    Points
    1 758
    Par défaut
    Script testé qui defrag tous les indexes d'une base qui sont fragmentés à plus de x% ou x est défini dans le code. Utilise dbcc indexdefrag et donc ne crée normalement pas de locks :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
     
    /*Perform a 'USE <database name>' to select the database in which to run the script.*/
    -- Declare variables
    SET NOCOUNT ON
    DECLARE @tablename VARCHAR (128)
    DECLARE @execstr   VARCHAR (255)
    DECLARE @objectid  INT
    DECLARE @indexid   INT
    DECLARE @frag      DECIMAL
    DECLARE @maxfrag   DECIMAL
     
    -- Decide on the maximum fragmentation to allow
    SELECT @maxfrag = 10.0
     
    -- Declare cursor
    DECLARE tables CURSOR FOR
       SELECT TABLE_NAME
       FROM INFORMATION_SCHEMA.TABLES
       WHERE TABLE_TYPE = 'BASE TABLE' --and table_name not in ('table_act_entry','table_case')
     
    -- Create the table
    CREATE TABLE #fraglist (
       ObjectName CHAR (255),
       ObjectId INT,
       IndexName CHAR (255),
       IndexId INT,
       Lvl INT,
       CountPages INT,
       CountRows INT,
       MinRecSize INT,
       MaxRecSize INT,
       AvgRecSize INT,
       ForRecCount INT,
       Extents INT,
       ExtentSwitches INT,
       AvgFreeBytes INT,
       AvgPageDensity INT,
       ScanDensity DECIMAL,
       BestCount INT,
       ActualCount INT,
       LogicalFrag DECIMAL,
       ExtentFrag DECIMAL)
     
    -- Open the cursor
    OPEN tables
     
    -- Loop through all the tables in the database
    FETCH NEXT
       FROM tables
       INTO @tablename
     
    WHILE @@FETCH_STATUS = 0
    BEGIN
    -- Do the showcontig of all indexes of the table
       INSERT INTO #fraglist 
       EXEC ('DBCC SHOWCONTIG (''' + @tablename + ''') 
          WITH FAST, TABLERESULTS, ALL_INDEXES, NO_INFOMSGS')
       FETCH NEXT
          FROM tables
          INTO @tablename
    END
     
    -- Close and deallocate the cursor
    CLOSE tables
    DEALLOCATE tables
     
    -- Declare cursor for list of indexes to be defragged
    DECLARE indexes CURSOR FOR
       SELECT ObjectName, ObjectId, IndexId, LogicalFrag
       FROM #fraglist
       WHERE LogicalFrag >= @maxfrag
          AND INDEXPROPERTY (ObjectId, IndexName, 'IndexDepth') > 0
     
    -- Open the cursor
    OPEN indexes
     
    -- loop through the indexes
    FETCH NEXT
       FROM indexes
       INTO @tablename, @objectid, @indexid, @frag
     
    WHILE @@FETCH_STATUS = 0
    BEGIN
       PRINT 'Executing DBCC INDEXDEFRAG (0, ' + RTRIM(@tablename) + ',
          ' + RTRIM(@indexid) + ') - fragmentation currently '
           + RTRIM(CONVERT(varchar(15),@frag)) + '%'
       SELECT @execstr = 'DBCC INDEXDEFRAG (0, ' + RTRIM(@objectid) + ',
           ' + RTRIM(@indexid) + ')'
       EXEC (@execstr)
     
     
     
       FETCH NEXT
          FROM indexes
          INTO @tablename, @objectid, @indexid, @frag
    END
     
    -- Close and deallocate the cursor
    CLOSE indexes
    DEALLOCATE indexes
    DROP TABLE #fraglist
    GO
    Sinon je te propose ce script ci, plus lourd (dbcc dbreindex) mais qui recrée tous les index d'une DB :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
     
    set nocount on
    ---------------------------
    -- Variables declaration --
    ---------------------------
     
    declare @i int -- Table Count
    declare @j int -- Index Count
    declare @nbTable int -- Table number
    declare @nbIndex int -- Index number
    declare @tableName varchar(255)  -- Table name
    declare @indexName varchar(255)  -- Table name
     
     
    -------------------------------------------------------------------
    -- Declare temporary tables which will be used to create the loop --
    -------------------------------------------------------------------
    create table #tmpTableList
    (
    	id int identity(1,1),
    	name varchar(255)
    )
     
    create table #tmpIndexList
    (
    	id int identity(1,1),
    	name varchar(255)
    )
     
     
    --------------------------------------------
    -- Load user table list in the temp table --
    --------------------------------------------
    insert into #tmpTableList
    select name 
    from sysobjects 
    where xtype = 'U' 
    order by name
     
    ----------------------------
    -- Counter initialisation --
    ----------------------------
    set @i = 1
    select @nbTable = count(id) from #tmpTableList -- Initialise nbTable variable
     
    ----------
    -- Loop --
    ----------
    while @i <= @nbTable
    begin
    	-----------------------------
    	-- Get the iteration table --
    	-----------------------------
    	select @tableName = name from #tmpTableList where id = @i
     
     
    	--------------------
    	-- Main loop code --
    	--------------------
     
    	-- Empty the indexes list table
    	truncate table #tmpIndexList
     
    	-- Fill the indexes list table with the indexes related from the table @tableName
    	insert into #tmpIndexList
    	select si.name from sysobjects so
    	join sysindexes si on so.id = si.id
    	where so.name = @tableName
     
    	-- Index count initialisation
    	set @j = 1
     
    	-- Initialise nbIndex variable
    	select @nbIndex = count(id) from #tmpIndexList
     
    	while @j <= @nbIndex
    	begin
    		-- Get the iteration index --
    		select @indexName = name from #tmpIndexList where id = @j
     
    		-- Reindex the @indexName index from the @tableName table
    		DBCC DBREINDEX(@tableName,@indexName)
     
    		-- Next iteration		
    		set @j = @j + 1
    	end
     
    	--------------------	
    	-- Next iteration --
    	--------------------
    	set @i = @i + 1
     
    end
     
    ------------------------
    -- Post loop commands --
    ------------------------
     
    -------------------------
    -- Drop the temp table --
    -------------------------
    drop table #tmpTableList
    drop table #tmpIndexList

    Pour plus d'info sur les 2 commandes dbcc, BOL

  10. #10
    Membre à l'essai
    Inscrit en
    Août 2009
    Messages
    22
    Détails du profil
    Informations forums :
    Inscription : Août 2009
    Messages : 22
    Points : 14
    Points
    14
    Par défaut script modifié ?
    Bonjour,

    Comment modifier ce script afin qu'il defragmente les indexes compris entre 0 et 30 ?

    SELECT @maxfrag < 30.0 ??? SELECT @maxfrag between 0 and 30 ?

    Merci d'avance

    Script:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    SET NOCOUNT ON
    DECLARE @tablename VARCHAR (128)
    DECLARE @execstr   VARCHAR (255)
    DECLARE @objectid  INT
    DECLARE @indexid   INT
    DECLARE @frag      DECIMAL
    DECLARE @maxfrag   DECIMAL
     
    -- Decide on the maximum fragmentation to allow
    SELECT @maxfrag = 10.0
     
    -- Declare cursor
    DECLARE TABLES CURSOR FOR
       SELECT TABLE_NAME
       FROM INFORMATION_SCHEMA.TABLES
       WHERE TABLE_TYPE = 'BASE TABLE' --and table_name not in ('table_act_entry','table_case')
     
    -- Create the table
    CREATE TABLE #fraglist (
       ObjectName CHAR (255),
       ObjectId INT,
       IndexName CHAR (255),
       IndexId INT,
       Lvl INT,
       CountPages INT,
       CountRows INT,
       MinRecSize INT,
       MaxRecSize INT,
       AvgRecSize INT,
       ForRecCount INT,
       Extents INT,
       ExtentSwitches INT,
       AvgFreeBytes INT,
       AvgPageDensity INT,
       ScanDensity DECIMAL,
       BestCount INT,
       ActualCount INT,
       LogicalFrag DECIMAL,
       ExtentFrag DECIMAL)
     
    -- Open the cursor
    OPEN TABLES
     
    -- Loop through all the tables in the database
    FETCH NEXT
       FROM TABLES
       INTO @tablename
     
    WHILE @@FETCH_STATUS = 0
    BEGIN
    -- Do the showcontig of all indexes of the table
       INSERT INTO #fraglist 
       EXEC ('DBCC SHOWCONTIG (''' + @tablename + ''') 
          WITH FAST, TABLERESULTS, ALL_INDEXES, NO_INFOMSGS')
       FETCH NEXT
          FROM TABLES
          INTO @tablename
    END
     
    -- Close and deallocate the cursor
    CLOSE TABLES
    DEALLOCATE TABLES
     
    -- Declare cursor for list of indexes to be defragged
    DECLARE indexes CURSOR FOR
       SELECT ObjectName, ObjectId, IndexId, LogicalFrag
       FROM #fraglist
       WHERE LogicalFrag >= @maxfrag
          AND INDEXPROPERTY (ObjectId, IndexName, 'IndexDepth') > 0
     
    -- Open the cursor
    OPEN indexes
     
    -- loop through the indexes
    FETCH NEXT
       FROM indexes
       INTO @tablename, @objectid, @indexid, @frag
     
    WHILE @@FETCH_STATUS = 0
    BEGIN
       PRINT 'Executing DBCC INDEXDEFRAG (0, ' + RTRIM(@tablename) + ',
          ' + RTRIM(@indexid) + ') - fragmentation currently '
           + RTRIM(CONVERT(varchar(15),@frag)) + '%'
       SELECT @execstr = 'DBCC INDEXDEFRAG (0, ' + RTRIM(@objectid) + ',
           ' + RTRIM(@indexid) + ')'
       EXEC (@execstr)
     
     
     
       FETCH NEXT
          FROM indexes
          INTO @tablename, @objectid, @indexid, @frag
    END
     
    -- Close and deallocate the cursor
    CLOSE indexes
    DEALLOCATE indexes
    DROP TABLE #fraglist
    GO

  11. #11
    Membre expert Avatar de iberserk
    Homme Profil pro
    Architecte de base de données
    Inscrit en
    Novembre 2004
    Messages
    1 795
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 42
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Architecte de base de données
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Novembre 2004
    Messages : 1 795
    Points : 3 173
    Points
    3 173
    Par défaut
    Bonjour,

    Comment modifier ce script afin qu'il defragmente les indexes compris entre 0 et 30 ?

    SELECT @maxfrag < 30.0 ??? SELECT @maxfrag between 0 and 30 ?

    Merci d'avance


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    WHERE LogicalFrag <= @maxfrag

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [debutant]compatibilite msde sql serveur 2000
    Par ChristopheOce dans le forum MS SQL Server
    Réponses: 2
    Dernier message: 20/01/2006, 08h39
  2. [MS SQL Serveur 2000] Problème sauvegarde restauration
    Par m-mas dans le forum MS SQL Server
    Réponses: 4
    Dernier message: 30/11/2005, 12h25
  3. [debutant]Plan de maintenance sous sql serveur 2000
    Par christophebmx dans le forum MS SQL Server
    Réponses: 2
    Dernier message: 05/05/2005, 12h18
  4. Taille Maxi pour un SQL SERVEUR 2000
    Par WOLO Laurent dans le forum MS SQL Server
    Réponses: 6
    Dernier message: 21/07/2003, 09h37
  5. Supprimer une colonne sous SQL Serveur 2000
    Par WOLO Laurent dans le forum MS SQL Server
    Réponses: 5
    Dernier message: 14/07/2003, 12h24

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo