Back-Up and Restoring in SQL Server 7.0

  • Hello everyone.

    I am having a problem with my backing up and restoring of databases. I created a database called "Temp" and I was able to save to back up the file using this syntax:

    BACKUP DATABASE Temp TO DISK 'C:\temp.bak'

    and it works fine. I then delete dsome data entries and I tried restoring using the ENTERPRISE MANAGER and it works fine. However, I then try to use the following syntax:

    RESTORE DATABASE Temp FROM DISK = 'C:\temp.bak'

    and it gives me the following error message:

    [Microsoft][ODBC SQL Server Driver][SQL Server]Database in use. The system administrator must have exclusive use of the database to run the restore operation.

    I have tried changing the database options with ENTERPRISE MANAGER to single user and DBO Use Only but it doesn't seem to do anything. I find this peculiar. Can anyone lend me some assistance or advice?

    Thank you.

    Juan R Tomasino

  • What database are you in when you are trying to run the job?  It sounds as if your Query Analyzer is pointing to the database you are trying to restore.

  • Well, I guess I am in the Temp database. Does this mean that I have to disconnect from the database and go run the restore command from another database?

    If this is correct, than I guess it makes sense.

    Is this correct? Thank you.

  • Yes this is correct.  You have to be out of the database for the restore to work. 

    <><

  • Thank you ......

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

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