Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 SQL Server Administration (2012)
 SQL Agent log file rollover
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Posting Yak Master

174 Posts

Posted - 01/19/2014 :  20:27:42  Show Profile  Reply with Quote
I have enabled verbose logging for an SQL Job related to transactional replication... The log file is starting to get rather large.

Is there a way to have the log file rollover once the log file reaches a certain size?


Posting Yak Master

174 Posts

Posted - 02/05/2014 :  11:32:25  Show Profile  Reply with Quote
Here is a short solution to this issue - POWERSHELL! I ran this script from an SQL Job to append a date and timestamp to the end of the log file.
The job runs once per day... Cheers...

$DateFileName = GET-DATE -FORMAT yyyy-MM-dd_hhmmss
Rename-Item <path>\<filename>.log -newname ("<filename>" + $DateFileName + ".log")

Edited by - dmaxj on 02/05/2014 12:43:00
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000