I'm trying to restore a DB using a stored procedure called from a .Net program and would like a little help.
I get an error saying it cannot do this because it is use by this session. I understand that because I accessed the stored proc that is in the DB I am trying to restore. It also says I should use the master DB for this. Does that mean I have to set up a user and the stored procedure in the master DB? Then open the master DB from the .Net program and run the master DB proc. I'm a little worried about what permissions I would have to give this user in the master DB. Any guidance on how to accomplish this would be appreciated.
Auguy
Sylvania/Toledo Ohio
Code:
-- Error checking removed
ALTER DATABASE Cemetery1 SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
RESTORE DATABASE Cemetery1 FROM DISK = @RestoreFileName
ALTER DATABASE Cemetery1 SET MULTI_USER;
Auguy
Sylvania/Toledo Ohio