SQLVerify method

  • Hi to all:

       I'm bulding an app to execute backups of sql databases for our helpdesk.

    I added the possibility to check the backups mades, by executing the SQLVerify method of the restore object. I'm using Visual Basic .NET.

    The problem is that I can't get the messages returned by the events. (I mean Percentage completed).

    I declared the object withevents, and if I run then SQLRestore method instead of the SQLVerify (Just for testing) I can get the messages in the event. But using SQLVerify, it won't return anything.

    It actually executes, because I can check with sp_who2  and DBCC INPUTBUFFER that the app is actually running a RESTORE VERIFYONLY.

    Any help would be appreciate.

    Thanks in advanced.

  • Hi,

    I would suggest to use SQL-DMO as I always use that for all my SQL Administrative Apps.

    Viraj Patel (askviraj@rediffmail.com)

     

  • From SQL BOL

    The SQLVerify method does not perform a restore of any SQL Server database or transaction log.

    To the best of my knowledge without building an app real quick, it will only throw an error on failure, otherwise nothing happens as far as return.

  • This is SQLDMO.

    The SQLVerify method is part of the SQLDMO.Restore object.

    Antares, I don't agree when saying that the verify doesn't return anything.

    Even from QA, running a RESTORE VERIFYONLY with return the percentage completed and the final status. And from BOL, the PercentComplete Event refers to SQLBackup, SQLRestore and SQLVerify, so I think that it should return the same that the other methods.

  • Having the same problem,
     
    Dim WithEvents oVerifyEvent As SQLDMO.Restore
    ...........................
    'verify events

    Private Sub oVerifyEvent_Complete(ByVal Message As String)

        PrintStat Message

    End Sub

     
    Private Sub oVerifyEvent_NextMedia(ByVal Message As String)

        PrintStat Message

    End Sub

     
    Private Sub oVerifyEvent_PercentComplete(ByVal Message As String, ByVal Percent As Long)

        ProgressBar1.Value = Percent

        DoEvents

    End Sub

    ................................
        Dim oVerify As SQLDMO.Restore

        gDatabaseName = CmBDatabaseName.Text

        Set oVerify = New SQLDMO.Restore

        Set oVerifyEvent = oVerify

       

        oVerify.Action = SQLDMORestore_Database

        oVerify.Database = gDatabaseName

        gBkupRstrFileName = RestorePad & gDatabaseName & ".bak"

        oVerify.Files = gBkupRstrFileName

        oVerify.ReplaceDatabase = True

        oVerify.FileNumber = 1

        oVerify.PercentCompleteNotification = 5

       

        oVerify.SQLVerify gSQLServer

     
    aint getting no response what so ever...  
     ...any help would be appriciated
     
     
     
     
  • I was wondering if you ever got this resolved. I am writing a small app in Visual foxpro 8.0 to use SqlVerify, but there is no response whatsoever.

    Actually, this line :

    llVerified = oRestoreEvent.SQLVerify(oSqlServer)

    returns NULL.

    Any ideas ?

    thanks,

    Bob

  • no, still waiting for someone with a solution...

  • BTW it's even getting worse, when I try to zip the bakfile created getting an error, propably because the verify still running and the bakfile is in use....
     
     
     

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

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