0

I am trying to restore SQL server DB, replacing the existing one but donot know how to do it. My purpose is to restore the backup file selected by user, no matter if file with this name is already attached to the server or not. If it is there, it should be replaced by the new one.

Could any body give me vb.net code for it?

Thanks

5
  • 2
    People normally do not respond well to Plz give me teh codez questions. Commented Feb 21, 2012 at 12:58
  • I'm interested to know this too. Interesting question. Commented Feb 21, 2012 at 12:59
  • 2
    sqldbatips.com/showarticle.asp?ID=40 Commented Feb 21, 2012 at 13:00
  • well JNK, my experience is entirely opposite. There are more good people on the planet than ...... ones ! Commented Feb 21, 2012 at 13:39
  • Because people help you when you are lazy doesn't mean that they are "good". There's nothing wrong with asking for help, but saying "Here is my issue please give me the code for it" is lazy. It shows you have not put forth any effort at all into solving your problem, but expect others to solve it for you. Some that's asked almost 300 questions would hopefully know where to start by now. Commented Feb 21, 2012 at 15:29

1 Answer 1

1

That's easy and hard.

Have you worked out what the sql is?

Are you restoring the entire back up or just a number of dbs out of it.

Do you want to sanity check it at all?

How are you going to deal with sql server's service account not having permission to see the file?

What about those using the database when it's requested.

Do you want to show progress as it restores?

Are there other considerations, emailing, permissions, MSMQ, replication.... Which sql server versions are you coping with?

If you aren't going to do this properly don't bother,m leave it the their IT / DBA people. The more hand holding you want to do, the more the scope will creep...

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.