Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a sql server running on a desktop and it has used up the disk space on C. I dont have historical data in the tables. SQL is used to process text files to then be loaded into TM1. All I need is the tables,views structure,etc. As a drastic measure, can I stop the service, delete the Database and its log files and recreate the tables and views with the same names and restart the service? will that reduce the log files to 0? I plan to do a regular back up of the log files after that.

share|improve this question
add comment

1 Answer

You would be better to carry out the following process:

  1. Set the database logging mode to simple
  2. Set the 'auto shrink' database option
  3. Shrink the log file with
    use <your_database>
    DBCC SHRINKFILE(2, 256)
    NB: this assumes your log file is file number 2 (which is typically the case).

You may need to run the DBCC command a couple of times to have the desired effect.

share|improve this answer
    
I have read so many posts not to shrink and that wont reduce the size of log files... –  telula Jul 27 '11 at 11:03
    
There are options for DBCC which only apply to the Data files, not the case for the command above. Also, note that I include instruction to set the logging mode to simple first - without this (or a backup of the transaction log, which doesn't apply in your use-case) then you're right, but with the log in simple mode, this will shrink the file on-disk - I've done this many times! –  Mike Insch Jul 27 '11 at 11:09
    
This may be a silly question, what does 256 indicate? –  telula Jul 27 '11 at 11:20
    
its ok, i figured it out, its 256 MB...Thanks I will try your suggestion tomorrow! –  telula Jul 27 '11 at 11:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.