Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7794119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:41:44+00:00 2026-06-01T22:41:44+00:00

I use this Tsql to select locked object in my database: select object_name(P.object_id) as

  • 0

I use this Tsql to select locked object in my database:

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

but this only show me the table that are lock now.how can i show the locked record.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T22:41:45+00:00Added an answer on June 1, 2026 at 10:41 pm

    The following code will help you find all the current requests on SQL Server and their statuses. I believe you cannot go to the record level. I maybe wrong on that.

    SELECT r.session_id, r.status, r.start_time, r.command, s.text, 
    r.wait_time, r.cpu_time, r.total_elapsed_time, r.reads, r.writes, r.logical_reads, r.transaction_isolation_level 
    ,r.* 
    FROM sys.dm_exec_requests r 
    CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) s
    

    The following will tell you what is blocking your request.

    select distinct object_name(a.rsc_objid), a.req_spid, b.loginame 
    from master.dbo.syslockinfo a (nolock) join 
    master.dbo.sysprocesses b (nolock) on a.req_spid=b.spid 
    where object_name(a.rsc_objid) is not null
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In TSQL I could use something like Select [table] from tablename to select a
I use this $query = SELECT * FROM info ORDER BY id DESC limit
select max(Key) from MyTable with(nolock) I have this T-SQL statement but need to use
I use this code to update data in database table. Can reuse same code
I use this code to process a date string coming in from a json
I use this code which is taken from MVC futures and attach the Attribute
I'm trying to use the Predicate from Albahari to create a TSQL statement like:
Is there a way in TSQL to do something like this: select a,b,c, case
look at this TSQL code: SELECT A, B, C, (MAX(A) - MAX(B))*C AS 'myCalculatedColumn',
So I have this query: select ens_use_new_models_bit from cfo_transaction inner join dbo.cfo_trans_entity_rel on te_tr_transaction_id=tr_transaction_id

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.