Make sure there are no problems in your db. If db have broken pages or indexes or any other you might receive error messages. So, in Query Analyzer do start with a:
- DBCC CHECKDB ('mydatabase') WITH ALL_ERRORMSGS
If DBCC runs OK, fine. But, it is most likely that many folks are letting EventLog, SiteLog and ScheduleHistory (and maybe other tables) continue to grow infinitely. So, perhaps they will find Error Messages. I just deleted all records in those Log tables before continuing with the rest Query Analyzer instructions.
NOTE: if you can afford to loose data in any of those Logging tables or you cannot delete all records when you try then do a:
- DBCC CHECKTABLE 'table_name', REPAIR_ALLOW_DATA_LOSS
Now it is time to know a bit more about your database settings. In query analyzer do a:
- exec sp_helpdb 'mydatabase'
Check size and recovery mode which perhaps is set to FULL. You may need to change to SIMPLE mode. Do this when in Studio Manager or Enterprise Manager: right click on your db, properties, options..find and set mode. Or, if you prefer Query Analizer
- exec sp_dboption 'mydatabase', 'trunc. log on chkpt.', 'TRUE';
Note: this weird parameter should be like witten like this 'trunc. log on chkpt.' abreviated and with a period (.)
Then, backup your log,
- BACKUP LOG mydatabase WITH TRUNCATE_ONLY
No single quote here.
Finally, shrink your db with option to truncate.
- DBCC SHRINKDATABASE ('mydatabase',TRUNCATEONLY)
I managed to free 800MB using this process.