/* Katherine Villyard, posted 8/31/12
http://www.katherinevillyard.com/2012/08/31/windows-internal-database-maintenance/
*/

Declare @today nvarchar(50), 
     @SQL nvarchar(4000) 
 

set @today = convert(nvarchar,GETDATE(),12) + '-' + replace(CONVERT(VARCHAR(26), GETDATE(), 108),':','')
 
	 set @SQL='BACKUP LOG [SUSDB] TO  DISK = N''F:\Transaction Logs\susdb-'+ @today +'.bak'' WITH FORMAT, INIT,  MEDIANAME = N''SUSDB-Transaction Log Backup'',  NAME = N''SUSDB-Transaction Log  Backup'', SKIP, NOREWIND, NOUNLOAD,  STATS = 10'
     EXEC SP_EXECUTESQL @SQL 

