Tout et n'importe quoi ...(de préférence)

Blog de CLT-Services : vie de l'entreprise et infos pratiques

Réindexer toute une base

Sunday, 19 November 2006 22:09 by damien

Un petit curseur pour réindexer toute la base; simple, efficace et pas cher !

USE MaBasegoDECLARE @TableName varchar(255)DECLARE TableCursor CURSOR FORSELECT table_name FROM information_schema.tablesWHERE table_type = 'base table'OPEN TableCursorFETCH NEXT FROM TableCursor INTO @TableNameWHILE @@FETCH_STATUS = 0BEGINDBCC DBREINDEX(@TableName,' ',90)FETCH NEXT FROM TableCursor INTO @TableNameENDCLOSE TableCursorDEALLOCATE TableCursorgo

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   SQL Server
Actions:   E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

Related posts

Add comment


(Will show your Gravatar icon)  

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

July 29. 2010 16:59

Search