开发者

SQL Server Maintenance Plan for fist 10 days of month

How to create a a mainte开发者_JAVA技巧nance plan for a full backup that run the first 10 days of the month in SQL 2008? THANKS!


Create the maintenance plan and schedule it to run every day.

Then go into the job in "SQL Server Agent" and modify the TSQL that launches the backup - put a condition there that will only execute the backup on the first 10 days of the month.

If DatePart (dd, GetDate()) < 11 
BEGIN
    BACKUP DATABASE AdventureWorks2008R2 
        TO DISK = 'Z:\SQLServerBackups\AdvWorksData.bak'
        WITH FORMAT;
END
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜