?
Solved

delete old back transacatio log files in MSSQL 08

Posted on 2012-09-14
3
Medium Priority
?
458 Views
Last Modified: 2012-09-18
Hello experts I need to delete old trasaction logs files and also backup db files on my MSSQL
Can anyone direct me how to do that?

Thanks
0
Comment
Question by:shpresa
3 Comments
 
LVL 9

Expert Comment

by:Vijaya Reddy Pinnapa Reddy
ID: 38400729
0
 
LVL 6

Accepted Solution

by:
Peter Kiprop earned 2000 total points
ID: 38401188
Hi  shpresa,

The below code should help you. You only need to replace the "Databasename" and "Databasename_log" with approriate Database name and database log name.


USE Databasename
GO
DBCC SHRINKFILE(Databasename_log, 1)
BACKUP LOG Databasename WITH TRUNCATE_ONLY
DBCC SHRINKFILE(Databasename_log, 1)
GO

Regards,
Pthepebble.
0
 

Author Comment

by:shpresa
ID: 38406894
Does the Shrink database under task will do the same thing?

Is there also a job to be scheduled to clean the old transaction logs with a certain age?


Thank you
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Recursive SQL is one of the most fascinating and powerful and yet dangerous feature offered in many modern databases today using a Common Table Expression (CTE) first introduced in the ANSI SQL 99 standard. The first implementations of CTE began ap…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question