Shrinking the log file???!!!

  • Hi

        I created a test table with some rows and after some table I truncated the table. The .mdf file size is reduced, but not the .ldf

        I dont want to rollback or anything of that sort. I want to know if theres a way to shrink the ldf file.

    thanks in advance

    -Vijay

  • Right-click your database;

    Choose Shrink Database ...from All Tasks;

    Click Files ...

    Choose ..._Log from the Database file dropdown box;

    Choose Shrink file to;

    Give a desired value;

    Click OK;

  • You can also use:

    DBCC SHRINKFILE (<FileName>, <TargetSize&gt

  • thanks a lot.....

  • Remember to perform a full database backup if you choose to run the DBCC shrinkfile command.  Since that command is not logged, it will invalidate your transaction log flow, thereby now allowing you to rollforward to point-in-time if needed.  I recently ran up on this bit of information myself and had to rewrite my DTS packages to add a backup as the final step after backing up and shrinking the transaction log. 

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply