Cancel the restore process of database and maintain the oroginal state of DB using SQLDMO in C#

  • Hi All!

    i am doing a C# application in which i need to Restore a database from a .bak file from my logical drives.I am able to restore the database sucessfully but what i need is the functionality to cancel the Restore process and after canceling the process i need to maintain the original state of the database.I am using SQLDMO to restore the database. Please give me some code snippet so that i can can the Restore process by clicking the cancel button and also maintaining the original state of the database.

    Regards,

    Ajit

  • This was removed by the editor as SPAM

  • This can't be done easly. Once you start a restore, you can't go back to the way it was without another restore. One way of doing this, depending on the size of your DB, would be to backup the DB before starting the restore. If you want to cancel the restore, kill the spid, and restore the backup.

  • What is the size of the database?

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

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