Hello, will somebody plz help me just tell me if i want to see all locks,session name,seesion id with t-sql .How,can we ? plz reply Thaxxxx..........
Execute sp_lock ... Read up on it in Books Online. In SQL 2005, execute select * from sys.dm_tran_locks
you can also see using management studio, under management tree, double click on activity monitor and click on locks ny objects or locks by processes
Hello, But I wish to see lock and sesions and what session are locked i know this sp_lock but will u plz tell me how can i see session name and session id .and all locks
Hello, But I wish to see lock and sesions and what session are locked i know this sp_lock but will u plz tell me how can i see session name and session id .and all locks
Not sure that there is such a thing as a "session name" - there's the SPID that identifies the connection being used by a process.
Hello, I have tried aba lockinfo it cant work .will u plz tell me simple query to see all locks and session name and session id that which session are locked .
If you want to get the T-SQL for what the graphical interface does, just start a trace, then use the interface to get the locking information. Stop the trace, copy the script, and edit to adjust to your liking.
You can make use of Performance dashboard reports in SQL 2005 - http://www.sql-server-performance.com/articles/per/bm_performance_dashboard_2005_p1.aspx