Backup and Restore is an important part of any application, but when you're writing an application for an end-user, it becomes even more important that you do a good job of handling Backup and Restore in your code since you end-user will likely not know much about being a Database Administrator. Add to that the fact that we don't include SQL Agent or the Maintenance Plan wizard in SQL Express, and you have the perfect reason to roll your own solution for Backup and Restore.
SQL Management Objects (SMO) offers two classes with the likely name of Backup and Restore that can help you handle this in your application. These objects are documented in Books Online and you can even find a sample of their usage here. One thing you won't find in the BOL example is information about how user instances impact the usage of these classes. Luckily, you have this blog and the help of your friends on the SQL Express forum.
Mfriedlander started a couple threads on the forum related to backing up and
As I travel around a lot of people see me running Windows Vista and are surprised. Often the comment is something like 'How can you run Vista and still be productive?'. I am the first to admit that there were challenges to start with. However these challenges had more to do with change than anything else. The fact of the matter was I knew XP inside out and Vista was different, so all of a sudden someone moved my cheese and I had no idea how to configure my network settings let alone configure Reporting Services to run on Vista. That's not to say that I haven't had some pain adapting to the change, as I remember one night before a presentation I was about to throw my laptop out the window as I was having all sorts of difficulty ensuring that a Reporting Services demo would work.
Recently the lease on my Subaru Forester came up and I leased another Forester. I was always particularly fond of having the volume control on the right hand side of the radio as it was within easy reach when my favourite song came on. However the new Forester has the volume on the left hand side of the radio which is not quite as convenient, meaning I sometimes miss the first few lines of a song being at volume 10. So am I going to downgrade my new car just because the volume is in a different spot – of course not. Instead I found out that there is a volume button on my steering wheel which is actually a better option than before, however I just need to get used to reaching for the steering wheel instead of the radio.
The more and more I use Vista, the more of these little features that I find. I have often used Norton Ghost and more recently Drive Snapshot to back up my laptop's. I have used these programs as they provide the ability for me to mount the backup as a drive which I can then copy a file from when needed. Over the weekend I decided to re-build my main laptop and decided to give the backup in Windows Vista a shot. To my surprise
I've waited far too long to communicate this disappointing news to everyone, so here it is…
I'm not going to be releasing the SQL Express SP2 Bootstrapper manifests that I had discussed in a long ago blog posting. I'll spare you the sob story of my efforts to create this; suffice it to say that some requirements arose that complicated an official release and priorities changed over time. If you work in the software industry you know how it goes. So that brings us to…
My feeble backup plan
Most of the complications (ok, all of them) that I ran into were related to packaging up the manifests so they could be downloaded and installed. (Seriously, it's a long story, so don't ask.) The manifests themselves are pretty straight forward and only required some minor tweaks of the existing RTM manifests. There is nothing to stop me from sharing those updates with you in this blog and giving instructions on how to use them.
DIY SQL Express Bootstrapper
Technically, the bootstrapper, or the VS Generic Bootstrapper as I like to call it, refers to the technology created by the Visual Studio team to allow any developer to deliver specific sets of functionality as prerequisites that can be checked for and automatically installed by both ClickOnce and MSI based installers built with VS. The framework for building your own prerequisite is documented on MSDN in the topic Adding Custom Prerequisites. A more end to end treatment of the technology was printed in MSDN magazine back in 2004 in the article Use