cancel
Showing results for 
Search instead for 
Did you mean: 

How can I truncate log with maintenance plan ?

Former Member
0 Kudos
3,597

I'm trying to schedule full and incremental backups with maintenance plans of database but it seems that It's not truncating logs of database so how can I do that in maintenance plan? Is there a option or do I have to schedule another script for that?

Accepted Solutions (1)

Accepted Solutions (1)

chris_keating
Product and Topic Expert
Product and Topic Expert

A maintenance plan is basically a UI that builds an event. You could modify the event to meet your specific needs. See BACKUP DATABASE statement for syntax of the statement used in the event to backup the database. To truncate the log, you will need to use the TRANSACTION LOG TRUNCATE backup option.

Answers (1)

Answers (1)

Former Member

In the box ro Run this SQL after the plan, you could put

BACKUP DATABASE DIRECTORY '' TRANSACTION LOG ONLY TRANSACTION LOG TRUNCATE; COMMIT;