Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Free Disk Space by Clearing Columns ? Expand / Collapse
Posted Tuesday, November 26, 2013 10:01 AM



Group: General Forum Members
Last Login: Wednesday, January 13, 2016 9:57 AM
Points: 2,881, Visits: 8,808
I have a huge archive table in a lightly used archive database. We really don't need all the data in each row, and I was considering updating a lot of columns to NULL. Will that free up space for reuse, either with or without shrinking the database file ? I don't want to actually drop the unneeded columns because I might break applications that populate & use the table, but I would like to reclaim space.

(SQL 2008 R0, std ed.)

Post #1517750
Posted Tuesday, November 26, 2013 11:19 AM



Group: General Forum Members
Last Login: Today @ 5:52 AM
Points: 44,010, Visits: 41,409
You'll definitely need to rebuild the clustered index to release the free space into the data file for reuse by other tables, may need to run DBCC CleanTable as well

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1517772
Posted Tuesday, November 26, 2013 9:11 PM



Group: General Forum Members
Last Login: Yesterday @ 8:36 PM
Points: 39,672, Visits: 36,812
I also believe that type of thing will only work on variable length columns, as well.

--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Favorite Quotes:
"Has anyone ever told you that a query you have written runs too fast?" - Dwain Camps - 6 Mar 2014

Helpful Links:
How to post code problems
How to post performance problems
Post #1517887
Posted Wednesday, November 27, 2013 12:47 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Saturday, February 28, 2015 10:12 AM
Points: 329, Visits: 1,019
You might want to consider table/index compression.

Edit: Sorry did not notice it was standard edition. Data compression not available
Post #1518186
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse