SQL Server Rcrd Locks via IIS

G

Guest

I have an Asp.net application that writes data to a SQL Server database. The
database has some stored procedures that are known to be poorly written which
can cause some records to become deadlocked. If I am running in debug mode
when this occurs, the code hangs and never returns. The records remain
deadlocked until the connection is broken (at least I think that is when it
frees).

What I would like to know is how to break that connection from my
development machine and local IIS server? Once the record is locked, I can
not free it until I reboot my computer. I've tried closing the development
environment and stopping IIS. Niether of those things work.

Can anyone make a suggestion of how I can break the lock without rebooting?
 
R

Roland Dick

Hi Jerry,
Can anyone make a suggestion of how I can break the lock without rebooting?

You could try to set the database to single-user and back to multi-user
again:
ALTER DATABASE <dbname> SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
ALTER DATABASE <dbname> SET SINGLE_USER;

Hope this helps,

Roland
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top