|
sql
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
alter table drop column and dbcc cleantableI just want to make sure my understanding is correct: 1) alter table drop column does not release space of varchar columns and other columns of variable length. 2) dbcc cleantable frees this space Open questions: 3) What about the space used by fixed size columns? Is it reclaimed during drop (timing lets me suspect that it's not)? dbcc cleantable "does not reclaim space after a fixed length column is dropped." http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_dbcc_4bah.asp Are rows inserted after a DROP COLUMN smaller? Thanks a lot! Kind regards robert Robert Klemme wrote:
Show quoteHide quote > All, http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_dbcc_4bah.asp> > I just want to make sure my understanding is correct: > > 1) alter table drop column does not release space of varchar columns > and other columns of variable length. > > 2) dbcc cleantable frees this space > > Open questions: > > 3) What about the space used by fixed size columns? Is it reclaimed > during drop (timing lets me suspect that it's not)? dbcc cleantable > "does not reclaim space after a fixed length column is dropped." > > No one wants to answer this one? Come on... I can even offer a virtual> Are rows inserted after a DROP COLUMN smaller? > > Thanks a lot! > > Kind regards > > robert hug. :-) Thanks! robert Well, its actually two questions.
1. DBCC CLEANTABLE does not reclaim CHAR and NCHAR columns, nor does the ALTER TABLE ... DROP COLUMN statement. Correct. 2. Are the rows inserted after the ALTER TABLE statement has been issued? Yes, new rows will only occupy the storage required for the new data definition contingent on the values of PAD_INDEX and FILLFACTOR for the Clustered Index. Now, the next logical question would be: how to I reclaim the space after issue the ALTER TABLE ... DROP COLUMN statement with a fixed-length column? Rebuild the Clustered Index. Sincerely, Anthony Thomas -- "Robert Klemme" <bob.n***@gmx.net> wrote in message Robert Klemme wrote:news:%23ypiPd4ZFHA.2212@TK2MSFTNGP14.phx.gbl... Show quoteHide quote > All, http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_dbcc_4bah.asp> > I just want to make sure my understanding is correct: > > 1) alter table drop column does not release space of varchar columns > and other columns of variable length. > > 2) dbcc cleantable frees this space > > Open questions: > > 3) What about the space used by fixed size columns? Is it reclaimed > during drop (timing lets me suspect that it's not)? dbcc cleantable > "does not reclaim space after a fixed length column is dropped." > > No one wants to answer this one? Come on... I can even offer a virtual> Are rows inserted after a DROP COLUMN smaller? > > Thanks a lot! > > Kind regards > > robert hug. :-) Thanks! robert Anthony Thomas wrote:
Show quoteHide quote > "Robert Klemme" <bob.n***@gmx.net> wrote in message http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_dbcc_4bah.asp> news:%23ypiPd4ZFHA.2212@TK2MSFTNGP14.phx.gbl... > Robert Klemme wrote: >> All, >> >> I just want to make sure my understanding is correct: >> >> 1) alter table drop column does not release space of varchar columns >> and other columns of variable length. >> >> 2) dbcc cleantable frees this space >> >> Open questions: >> >> 3) What about the space used by fixed size columns? Is it reclaimed >> during drop (timing lets me suspect that it's not)? dbcc cleantable >> "does not reclaim space after a fixed length column is dropped." >> > Show quoteHide quote >> Ok.>> Are rows inserted after a DROP COLUMN smaller? >> >> Thanks a lot! >> >> Kind regards >> >> robert > > No one wants to answer this one? Come on... I can even offer a > virtual hug. :-) > Well, its actually two questions. > > 1. DBCC CLEANTABLE does not reclaim CHAR and NCHAR columns, nor does > the ALTER TABLE ... DROP COLUMN statement. Correct. > 2. Are the rows inserted after the ALTER TABLE statement has been Ok.> issued? Yes, new rows will only occupy the storage required for the > new data definition contingent on the values of PAD_INDEX and > FILLFACTOR for the Clustered Index. > Now, the next logical question would be: how to I reclaim the space Ok, so basically the space is not reclaimed until either the complete> after issue the ALTER TABLE ... DROP COLUMN statement with a > fixed-length column? > > Rebuild the Clustered Index. table is rebuild or old records are deleted. Thanks a lot! You get the virtual hug: *hug* :-) Kind regardsrobert
Problem with osql.exe -L
Simple Question: What's the best way to duplicate a DB under another name? Server: Msg 7391, Level 16, State 1, Procedure <OBJECT>, Line varchar vs nvarchar stored procedure with different criteria SQL7 2 DB files down to one??? Query Cost - how is it calculated? Removing Identity Property Autonumber Format Numbers |
|||||||||||||||||||||||