Tips for SQL
April 21, 2010 Leave a Comment
How to find the lock table in sql 2008?
Select
object_name(P.object_id) as TableName,
resource_type, resource_description
from
sys.dm_tran_locks L
join sys.partitions P on L.resource_associated_entity_id = p.hobt_id
Other way to get the lock object
select * from sys.objects where name =’<<Table Name >>’
–You will get object id for table(2081546599
sp_lock — it gives number of records, find out the exact number ex. 2081546599 from the records and kill them following way
kill 53
kill 71
How to use the Link server using query?


