SQL Express – Backup Plan

SQL express doesn’t have the luxury of SQL maintenance plans, but you can still write a SQL script to dump a database to a particular location and run it via task scheduler on a daily basis.

Create SQL query and save it to a particular location… (NightlyBackup.sql)


SET @pathName = ‘D:\SQL Backup\database_‘ + Convert(varchar(8), GETDATE(), 112) + ‘.bak’


Create cmd / bat and save to similar location to above… (Backup DB to disk.cmd)

sqlcmd -S servername\INSTANCENAME -U sqluser -P sqluserpassword -i “NightlyBackup.sql”

forfiles /p “C:\SQLBackupLocation” /m *.bak /s /d -2 /c “cmd /c del @file : date >= 7 days >NUL”

Create windows task schedule event to run above at 5:30pm everyday. 

145 Replies to “SQL Express – Backup Plan”

  1. My husband and i have been absolutely peaceful that Jordan could round up his reports through your precious recommendations he got using your web pages. It is now and again perplexing just to continually be offering tricks that a number of people have been trying to sell. Therefore we do understand we have got you to appreciate for that. The main illustrations you have made, the straightforward site navigation, the relationships you assist to instill – it is all unbelievable, and it’s helping our son and our family imagine that the situation is brilliant, which is certainly very serious. Many thanks for all the pieces!

  2. I like the valuable information you provide in your articles. I will bookmark your weblog and check again here regularly. I am quite sure I will learn plenty of new stuff right here! Good luck for the next!

  3. Hey, you used to write magnificent, but the last several posts have been kinda boring¡K I miss your super writings. Past few posts are just a little bit out of track! come on!

  4. I have been exploring for a little bit for any high quality articles or blog posts in this kind of house . Exploring in Yahoo I at last stumbled upon this web site. Studying this info So i¡¦m happy to show that I have a very good uncanny feeling I found out just what I needed. I so much indubitably will make sure to don¡¦t disregard this website and give it a look on a relentless basis.

  5. Thanks for some other informative website. Where else may just I get that type of information written in such an ideal approach? I have a venture that I am just now running on, and I have been on the look out for such information.

  6. Wow, marvelous blog layout! How long have you been blogging for? you made blogging look easy. The overall look of your web site is wonderful, as well as the content!

  7. I¡¦m not sure the place you are getting your information, however good topic. I needs to spend some time finding out much more or figuring out more. Thank you for magnificent info I was looking for this information for my mission.

  8. I do not even know how I ended up here, but I thought this post was good. I do not know who you are but certainly you are going to a famous blogger if you are not already ;) Cheers!

  9. I and my guys were actually checking out the excellent ideas on your web site and then suddenly I got a horrible suspicion I never expressed respect to the website owner for those tips. Those young boys came totally glad to see them and have in effect truly been taking advantage of them. Appreciation for genuinely well helpful and for obtaining this sort of remarkable subjects most people are really wanting to be aware of. Our own sincere apologies for not expressing appreciation to earlier.

  10. magnificent issues altogether, you just received a logo new reader. What could you suggest in regards to your put up that you simply made a few days in the past? Any sure?

  11. I was just searching for this info for some time. After 6 hours of continuous Googleing, at last I got it in your site. I wonder what’s the lack of Google strategy that don’t rank this kind of informative web sites in top of the list. Generally the top sites are full of garbage.

  12. Hello, Neat post. There is an issue with your web site in web explorer, would test this¡K IE still is the marketplace chief and a good component to people will omit your excellent writing because of this problem.

  13. It¡¦s actually a cool and helpful piece of info. I am happy that you just shared this helpful information with us. Please stay us informed like this. Thank you for sharing.

  14. Thanks for the sensible critique. Me and my neighbor were just preparing to do a little research on this. We got a grab a book from our area library but I think I learned more clear from this post. I am very glad to see such excellent info being shared freely out there.

  15. Wow! This can be one particular of the most helpful blogs We’ve ever arrive across on this subject. Basically Fantastic. I am also an expert in this topic so I can understand your effort.

  16. Its like you read my mind! You seem to know so much about this, like you wrote the book in it or something. I think that you could do with some pics to drive the message home a little bit, but other than that, this is magnificent blog. An excellent read. I will definitely be back.

  17. I simply want to tell you that I’m new to blogs and absolutely enjoyed this web site. Likely I’m likely to bookmark your website . You surely come with outstanding writings. Kudos for sharing your website page.

  18. I just want to mention I’m newbie to blogging and seriously savored you’re web-site. Almost certainly I’m planning to bookmark your blog post . You really come with really good posts. Regards for sharing your website.

  19. This is very interesting, You are a very skilled blogger. I’ve joined your rss feed and look forward to seeking more of your excellent post. Also, I have shared your web site in my social networks!

  20. Thank you a lot for giving everyone a very nice opportunity to check tips from this web site. It’s usually so kind and also jam-packed with fun for me and my office peers to search the blog at a minimum thrice every week to read through the fresh guides you will have. And definitely, we’re certainly pleased with all the fabulous secrets you give. Certain 2 tips in this posting are easily the most efficient I’ve had.

  21. I simply want to tell you that I’m new to blogs and truly loved you’re web blog. Probably I’m planning to bookmark your site . You absolutely come with wonderful posts. Appreciate it for sharing with us your web site.

  22. Great ¡V I should definitely pronounce, impressed with your web site. I had no trouble navigating through all tabs and related information ended up being truly easy to do to access. I recently found what I hoped for before you know it at all. Quite unusual. Is likely to appreciate it for those who add forums or anything, web site theme . a tones way for your customer to communicate. Excellent task..

  23. Hiya, I’m really glad I have found this info. Nowadays bloggers publish only about gossips and net and this is really annoying. A good website with interesting content, this is what I need. Thanks for keeping this web site, I’ll be visiting it. Do you do newsletters? Cant find it.

  24. Hello there, just became alert to your blog through Google, and found that it’s truly informative. I am going to watch out for brussels. I will appreciate if you continue this in future. Numerous people will be benefited from your writing. Cheers!

  25. Attractive section of content. I just stumbled upon your weblog and in accession capital to assert that I get actually enjoyed account your blog posts. Anyway I’ll be subscribing to your feeds and even I achievement you access consistently rapidly.

  26. Whats Going down i am new to this, I stumbled upon this I have discovered It absolutely useful and it has aided me out loads. I’m hoping to give a contribution & aid other users like its aided me. Good job.

  27. We are a group of volunteers and starting a new scheme in our community. Your website offered us with valuable info to work on. You’ve done an impressive job and our whole community will be thankful to you.

  28. Thank you for the sensible critique. Me and my neighbor were just preparing to do some research on this. We got a grab a book from our area library but I think I learned more clear from this post. I’m very glad to see such excellent info being shared freely out there.

  29. I wanted to post you that tiny remark in order to thank you very much as before regarding the pleasing strategies you have contributed here. It was so open-handed of you to deliver publicly what exactly a number of people could have sold as an e book to help make some bucks for their own end, especially considering that you could have done it if you desired. Those solutions in addition worked like a fantastic way to fully grasp that other individuals have the identical zeal much like my own to learn a whole lot more on the topic of this issue. I’m sure there are many more pleasurable periods ahead for many who scan your blog.

  30. I would like to thnkx for the efforts you’ve put in writing this site. I am hoping the same high-grade web site post from you in the upcoming as well. Actually your creative writing skills has encouraged me to get my own web site now. Really the blogging is spreading its wings fast. Your write up is a good example of it.

  31. Unquestionably believe that which you stated. Your favorite reason seemed to be on the internet the simplest thing to be aware of. I say to you, I definitely get annoyed while people think about worries that they plainly do not know about. You managed to hit the nail upon the top as well as defined out the whole thing without having side effect , people can take a signal. Will probably be back to get more. Thanks