Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Restore database using script

Hi

I am attempting to restore a database using a simple procedure, however I
keep hitting the error msg 3101 "Database in use, need exclusive access.."
although no one else is accessing the db. My procedure is simply:
CREATE PROCEDURE restore_db AS
RESTORE DATABASE movies
FROM [c:\mssql7\backup\movies]
GO

I would appreciate any help with this, as it is frustrating!

Thanks
Fred
[434 byte] By [Frederic] at [2007-11-9 21:10:05]