Your Webhosting Questions
Answered by the Webhosting Experts

Shrink MsSql DB Logs

1. Open query analyser. Do not open Enterprise Manager.
2. Let the database be selected as “Master”
3. Fire the command



This should show you a success message

4. Now change the database seclected in query analyser to “DATABASE_NAME” where DATABASE_NAME is the name of the database which needs modified
5. Fire the command as below:

DBCC SHRINKFILE ('db0098Log', 1);

where database-name_Log is the name of the log file of the db concerned. Such as test_Log. And the valuew ‘1’ indicates the size that the log file needs to be shrunk to. This can be any value depending on the size of the log file of the db. This value is considered in MB’s.

PS: if you copy and paste the above command in QA, it will throw a syntax error message. You should rather key it in or if you do copy and paste the query, then delet the D at the start of the query and key it in again and do the same for the training bracket. The query will run without trouble then.

Need More Personalized Help?

If you have any further issues, questions, or would like some assistance checking on this or anything else, please reach out to us from your account and provide your server credentials within the encrypted field for the best possible security and support.

If you are unable to reach your account or if you are on the go, please reach out from your valid account email to us here at: We are also available to you through our phone and live chat system 24/7/365.