How do I check or remove locks from SQL Server

Hi experts,
How do you check for, and remove locks in SQL Server 2008 R2?

Thanks in advance,
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kanti PrasadCommented:

To check for lock you can look at the store procedures sp_who & sp_lock
Deepak ChauhanSQL Server DBACommented:
locking is the expected behaviour of sql server. which sql server use to maintain the transaction consistency. For complete information yuo have to go through the Transaction and concurrency. However in case of blocking you can simply kill the SPID but before that be more carefull and find the actual cause of the blocking.

select * from sys.sysprocesses

killing the process

kill SPID -- which is blocking other SPID.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Vitor MontalvãoMSSQL Senior EngineerCommented:
Can you be more precise on what you want to do?
There are few ways to check and prevent locks.
What you mean with remove locks? Tuning the query to prevent future locks or kill the blocking process?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.