sql server - Shrink database or DB files not reducing size although I dropped biggest table - Database Administrators Stack Exchange


our mdf file 580gb in size, , biggest table had [hourlycounters] 140 million rows 580 columns (varchar[50]). it's table inefficient schema, there's nothing can that.

anyways, after moving data around, able drop [hourlycounters]. now, new table (with same name) has 50k rows. ran shrinkdatabase , shrinkfile, mdf went down 40gb. know that's decent chunk, know fact dropped table larger (the current backup of table 7m rows 63gb).

how can sql server release free space? new version of [hourlycounters] doesn't have indexes, know old 1 did have them.

it's worth mentioning how went dropping table:

  • rename original table [hourlycounters] [hourlycounters_old] right-click in ssms , rename. table had indexes.
  • create new table [hourlycounters] no indexes processes stored in table not affected.
  • create table [hourlycounters_new] store recent data [hourlycounters] (now called [hourlycounters_old]). table has 7m rows.
  • drop [hourlycounters_old]

thanks.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -