Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
bridge
Yak Posting Veteran
93 Posts |
Posted - 2005-05-12 : 02:28:21
|
| One of my table was having 900 columns with data type float (4 bytes). The DB size was 545MB. As now I have deleted the 892 columns, the DB size has reduced to 543. while I think there must be considerable reduction in size. What DBCC commands should I run for reducing the DB size? |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-05-12 : 03:22:24
|
| Look for shrinking databases in BOLMadhivananFailing to plan is Planning to fail |
 |
|
|
bridge
Yak Posting Veteran
93 Posts |
Posted - 2005-05-12 : 03:45:37
|
| I have shrinked the database. But when there were 900 columns, each row was in a single page so there were as many pages as the number of rows. Now there are only 8 columns, so there should be around 250 rows in a single page if the columns are 4 byte float, and some bytes for page header. What I may do that rows shift to pages and pages will be reduced? |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2005-05-12 : 07:15:30
|
| DBCC DBREINDEX will rebuild your table's indexes and should rearrange pages to fit more rows per page. I'd recommend creating a clustered index on that table if you don't already have one; if you created a primary key using the defaults then you should be all set. You can check by running "sp_helpindex" on that table and checking the results. Books Online has more information about these commands. |
 |
|
|
bridge
Yak Posting Veteran
93 Posts |
Posted - 2005-05-13 : 01:21:44
|
| I checked the index and it is nonclustered, unique, primary key located on PRIMARY.I want to know why will you recomment Clustered Index? |
 |
|
|
|
|
|