Backing Up a Database with SMO

  • Comments posted here are about the content posted at http://www.sqlservercentral.com/columnists/btarvin/2900.asp

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • I enjoyed the article.  Can this application be built with Visual Basic Express Edition?

    David Bird

  • Honestly, I haven't actually worked Visual Basic Express, just Studio 2005.  Google has lots of information about SQL Server Express and the SMO object, but I can't seem to find anything about using SMO with Visual Basic Express. 

    Since SMO is supposed to be included with SQL Server Express, though, and since SQL Express is supposed to be usable with VB Express, I would say "yes" with a caveat.  As long as you can create the appropriate references, import the SMO objects and are using Visual Basic Express 2005, that you should be able to do this project using that tool.

    Now you've got me wondering, though.  I'm going to have to download the Express version and give it a whirl.  @=)

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • Useful article. A few typos in the code though maybe?

    Module CreateInitialConnection Public ProdServer As New Server()

    Public ProdConn As ServerConnection

    [...]

    should read (note line break)

    Module CreateInitialConnection

    Public ProdServer As New Server()

    Public ProdConn As ServerConnection

    [...]

    and

    ImportsMicrosoft.SqlServer.Management.Smo

    Imports Microsoft.SqlServer.Management.Common

    should read

    Imports Microsoft.SqlServer.Management.Smo

    Imports Microsoft.SqlServer.Management.Common

    Also, as a vb.net newbie I don't know if this is required in all cases but I got a failure every time I tried to run the code until I went into Project Properties -> Security and enabled "Enable ClickOnce Security Settings" and checked "This is a full trust application"

  • Good catch on the typos!  Thanks for pointing them out.

    I apologize for not mentioning the Security Settings.  I re-create this project 3 times to make sure my code worked consistantly and don't remember setting those two properties.  But when I went back and checked, sure enough, they were there and they were checked.  And it isn't a default setting on my Visual Studio, either.  So, that is definitely my bad.  Sorry for the confusion.

    I take it you finally got this working?

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • Nice and useful article.

    Is it possible to take backup in any other drives or specific location other the default sql backup folder.

    how to configure the specific location?

    Please help me to do this.

  • I'm not quite sure I understand the question.

    Are you saying you want to save SQL Database backups to a different location? Or that you want to pull non-SQL Database backups somewhere?

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • Good article, Brandie. I appreciated the steps to create the MSI file - I've written a lot of SMO but have never taken the time to create the MSI. Thanks for the how-to.

    Tim Mitchell, Microsoft Data Platform MVP
    Data Warehouse and ETL Consultant
    TimMitchell.net | @Tim_Mitchell | Tyleris.com
    ETL Best Practices

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply