Click here to Skip to main content
15,897,718 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends,

I am working on a Windows application where I am restoring .bak file to SQL 2005 Server through C#, but I am getting an error that "database is in use". Please help....
Posted
Updated 8-Mar-10 0:12am
v3

Check "Management" --> "Activity Monitor" from Management Studio to see who is using the database (you can force disconnect if neccessary).

Or you could try this http://blog.newslacker.net/2008/02/sql-server-2005-disconnect-users.html[^]
 
Share this answer
 
v3
To restore databases the restore process needs exclusive access to it, that means no other users can be connected. So you need to make sure no one is using the DB
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900