+ 'Description = ' + '''' + + ' Backup'',' + Char (13)įetch next from database_cur into - whileĪccording to Books Online (BOL), if INIT is specified, any existing backup set data on that device is overwritten. print - this will print the SQL commands, good to checkĮxec - if you do not rem this line it will execute the sql command in the above lineįetch next from delete_cur into - while ![]() Set = 'EXEC master.xp_cmdshell ' + + ', no_output' Select from sysdatabases where not in ('master', 'model', 'msdb', 'tempdb') order by ![]() SET = (select convert(varchar(12), getdate(), 112)) Each backup will have the following naming convention : DBName_Date.BAKīackups older than two days are deleted prior to the execution of the backups. * SP which will perform a FULL Backup of all User Databases. ![]() This script will take fullbackup with Datetimestamp and remove the two days older file from the backup folder. You can Schedule this in maintenance plan or check the below SP this can help you to achive your goal just do the small modification
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |