tei219

dbcc_dbreindex

Mar 28th, 2012
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. exec sp_MSforeachtable @command1 = '
  2.     print(''use ''+db_name()+''; dbcc dbreindex(''''?'''')'','''''''',80)
  3. '
  4.  
  5. exec sp_MSforeachtable @command1 = '
  6.     print(''use ''+db_name()+''; dbcc dbreindex(''''''+object_name(object_id(''?''))+'''''','''''''',80)'')
  7. '
Add Comment
Please, Sign In to add comment