-1

Im looking for a scrip that I can just point at a .bak file and it will delete the current db and then restore the .bak file in its place. And will close all connections. Does anybody know of a script that will do this?

I want to do it in c#.

Exitos
  • 29,230
  • 38
  • 123
  • 178

1 Answers1

0

You should start by looking at SQL Server Management Object, in particular the Restore class.

Joe
  • 122,218
  • 32
  • 205
  • 338