I need to restore a SQL Server 2000 database to a backup of about 2 days ago. I have just backed it up and have tried to restore it, but it says it is in use.
What is the best way to find out who is still using it and then how to disconnect them?
I imagine taking the DB offline is a simple way of doing it, but probably not the safest?
Best Answer
Running
sp_who2
will show you who is connected to the database.The safest way to disconnect users is to ask them to disconnect themselves. If that is not practical, you can take the database offline or set it to
SINGLE_USER
mode to force the other connections out before performing your restore.See this for more information and examples: