Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Decreased column size in a table but table size grew

Status
Not open for further replies.

bmacbmac

IS-IT--Management
Jan 26, 2006
392
US
Hi!

I have a table temp with path varchar(1000). I reduced the path size with:

Code:
alter table temp
alter column temp varchar(500)

After I did this the table size actually grew. I reduced again to varchar(4000 and the table size grew again.

Is there another action I should take after adjusting the column size? I was hoping to reduce the size of the table, but it is increasing.

Thanks!
 
looks like a heap table. Normal to behave like that.

do "alter table temp rebuild" and see how it goes - and with very few exceptions Heaps in SQL Server are not the best for a table - adding a cluster index is normally advisable and will most likely also solve the issue you see here.

Regards

Frederico Fonseca
SysSoft Integrated Ltd

FAQ219-2884
FAQ181-2886
 
How do you measure table size? There are many possibilities and you need to know how to interpret them.

The ldf size will most certainly rise, as you cause a large transactions with this table change. This can only shrink after log backups and shrinking the ldf, which also needs your luck of the active internal portion of the ldf not to wrpa around from end of file to begin of file.

An even if ata can be stored in less pages within the mdf, that also doesn't automatically shrink it. But you certainly free pages for use of other data storage.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top