How to restore an ExpressMaint Backup

Jun 15, 2009 at 8:32 PM

I haven't tried this yet, but I was wondering how restoring works?

 

Coordinator
Jun 15, 2009 at 10:37 PM

Restore is the same as normal (use TSQL commands or the SSMS Express GUI), there is no specific support for restoring a database using the tool as if anything it would make it more complicated. SSMS Express would be the choice for the non DBA although the TSQL syntax for RESTORE is relatively straightforward and well documented in Books Online. I could add an article about this if you think it would be useful?

Oct 19, 2009 at 2:19 AM

Hi,

  I have managed to create backups, but am not able to restore. I have tried to do it my self a couple of times using this code:

Module SMOTest
    Sub Main()
        Dim svr As Server = New Server()
        Dim res As Restore = New Restore()
        res.Devices.AddDevice("C:\SMOTest.bak", DeviceType.File)
        res.Database = "SMO"
        res.ReplaceDatabase = True
        res.PercentCompleteNotification = 10
        AddHandler res.PercentComplete, AddressOf ProgressEventHandler
        res.SqlRestore(svr)
    End Sub

    Private Sub ProgressEventHandler(ByVal sender As Object, _
                                     ByVal e As PercentCompleteEventArgs)
        Console.Writeline(e.Percent.ToString + "% restored")
    End Sub
End Module

 

 

from this Website: http://www.sqldbatips.com/showarticle.asp?ID=40

I have tried to run this via MS Access VBA, but I get the error "Invalid Use of Property" on the "Module" part of "Module SMO", so I am definatley doing something wrong.

 

I would really appreaciate your guidance. Thanks

 

Coordinator
Oct 20, 2009 at 7:32 AM

I'm pretty sure you can't use SMO from VBA. In the early days of SQL 2005 it was callable from COM and you could use VBScript for example to execute SMO code however this was removed prior to RTM. I don't know much about Access but had a quick look and it doesn't look like you can add a reference to the required SMO assemblies.

Oct 20, 2009 at 7:57 AM

Hi Jaspersmith Thanks for the response. 

Would I be able to restore the backups using SQL Server Management Studio Express. If so how would I do that, if you could explain it as if you were explaining it to a student or complete novice that would be greatly appreciated. If it is not possible via SQL Server Management Studio Express what would be your suggestion on how to restore the backed up DB.

 

 

Thanks

 

 

Coordinator
Oct 20, 2009 at 4:04 PM

I'll put together a blog post with step by step instructions and screenprints, might take a few days :-)

Oct 20, 2009 at 11:51 PM

Instructions would be great.

 

Thanks a lot

Coordinator
Oct 21, 2009 at 7:04 PM

Here you go, this is for restoring a full database backup using SQL Server Management Studio Express. I'll put together some other guides for different scenarios

http://sqlblogcasts.com/blogs/sqldbatips/archive/2009/10/21/restoring-an-expressmaint-backup-using-sql-server-management-studio-express.aspx