If SQL Server does not find the old error log when it is started, it will create a new one. If it does find the old error log, it will reopen the error log and append to it. It is important to watch the> In addition, it is possible that the error log will not be placed in the \SQL\LOG directory. When SQL Server is started with "sqlservr", the "/e" option is used to tell it where to place the error log. If this option is omitted, SQL Server will put the error log in the default directory when "sqlservr" was started.
One way to keep old copies of the error logs is to write a .CMD file that will perform this type of functionality. For example:
echo off
cd\
if exist errorlog.6 del errorlog.6
if exist errorlog.5 ren errorlog.5 errorlog.6
if exist errorlog.4 ren errorlog.4 errorlog.5
if exist errorlog.3 ren errorlog.3 errorlog.4
if exist errorlog.2 ren errorlog.2 errorlog.3
if exist errorlog 1 ren errorlog.1 errorlog.2
sqlservr /d /e
NOTE: Instead of using the "/d" and "/e" options, it is also acceptable to use the "-d" and "-e" options. For example: