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 |
|
dr223
Constraint Violating Yak Guru
444 Posts |
Posted - 2010-01-05 : 07:11:29
|
| Hi,I have a database in SQL server 2005 called ODSData5 and the files are as follows:ODSData5.mdf = 50.3 GBODSData5_log.ldf = 2MB This was the original size of the database, then I deleted 27 columns from table called 'opat' (this table is built up with 118 M records) from the database. At this level, I expected the size of the mdf file to reduce drastically. However, the size of the mdf file never changed. Therefore, I ran DBCC Shrinkdatabase(ODSData5).. It never helped either, though, it reduced the size of log file to 2 MB. Now, I run these 2 runs and please see the results below each run; Use ODSData5GoExec sp_spaceused N'dbo.o_pat'GoResultsname: opatrows: 118917656reserved: 52817344 KBdata: 42542352 KBindexsize: 10268288 KBUnused: 6704 KBThen I run; Use ODSData5 GoExec sp_spaceusedGoResultsdatabase_name: ODSData5database_size: 51584.19 MBunallocated space: 0.88 MBreserved: 52819264 KBdata: 42543464 KBunused: 6888 KBPlease could anyone advice me how I can reduce the size of the mdf file. Deleting the 27 columns seemed not to be helping.. Thanks |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
kishore_pen
Starting Member
49 Posts |
Posted - 2010-01-06 : 04:36:43
|
| use DBCC UPDATEUSAGE (<DBName>), for more info see SQL BOL. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
behrman
Yak Posting Veteran
76 Posts |
|
|
|
|
|
|
|