I am facing an issue while restoring the database.
I have many dump files in a folder and I try to restore them one by one to a database xyz, perform some update operation and continue my restore operation with the other dumps. During this restore operation all the other databases are entering the state of In Recovery . Also the database xyz is also entering the state of recovery and my restore operation fails for the 2nd dump saying the "Not able to achieve exclusive lock on the xyz" .
I am using SQL Server 2008 R2.
So how can I solve this issue please suggest.