JaybeeinTekTips
Technical User
Hi all,
Can anyone tell me whether the syntax will work for renaming a logfile by appending the current date/time to the end, and what the "112" specifies?
Thanks,
JB
/****************************************************************************/
declare @s varchar(8000)
select @s = 'rename "E:\LBBSVS01\LOGS\MSSQL$LBBSQL01\Logs\aspstate_log.LDF" "E:\LBBSVS01\LOGS\MSSQL$LBBSQL01\Logs\aspstate_log(' + convert(varchar, getdate(), 112) + ').LDF"'
xp_cmdshell @s
/****************************************************************************/
Can anyone tell me whether the syntax will work for renaming a logfile by appending the current date/time to the end, and what the "112" specifies?
Thanks,
JB
/****************************************************************************/
declare @s varchar(8000)
select @s = 'rename "E:\LBBSVS01\LOGS\MSSQL$LBBSQL01\Logs\aspstate_log.LDF" "E:\LBBSVS01\LOGS\MSSQL$LBBSQL01\Logs\aspstate_log(' + convert(varchar, getdate(), 112) + ').LDF"'
xp_cmdshell @s
/****************************************************************************/