How do i get restore succeed according to the code below?

  • How could i know just restore succeeded?

    According to this code:

    declare

    @qStr varchar(512),

    @i int

    set @qStr = 'RESTORE DATABASE ...'

    EXEC @i = sp_executesql @qStr

    PRINT @i

    Fails....

  • thinknight (7/13/2010)


    How could i know just restore succeeded?

    According to this code:

    declare

    @qStr varchar(512),

    @i int

    set @qStr = 'RESTORE DATABASE ...'

    EXEC @i = sp_executesql @qStr

    PRINT @i

    Fails....

    You're not using standard syntax for the restore operation at all. Here is the full syntax for the restore operation.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • I just want to verify restore operation finished successfully? How do i get result of restore with t-sql scripts?

  • Use try - catch

    The probability of survival is inversely proportional to the angle of arrival.

  • Yes it is the correct solution. TRY..CATCH how do i not apply this?

    Thanks 🙂

Viewing 5 posts - 1 through 4 (of 4 total)

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