Showing posts with label note. Show all posts
Showing posts with label note. Show all posts

Wednesday, March 21, 2012

Exclusive access could not be obtained because the database is in use.

How to close the existing connections to a particluar database in sql server. Please note that i donot want to start stop sql server. I just want to close the existing connections so that i can do a restore on that database programatically.

I am using sqldmo for this purpose. Does anyone knows how to do that with sqldmo or is there any other method??

Waiting for your earliest repliessp_who2
followed by
kill <process id>