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#.
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#.
You should start by looking at SQL Server Management Object, in particular the Restore class.