In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces the sqlserver query locking sql and unlocking methods, the article is very detailed, has a certain reference value, interested friends must read it!
-- View the locked table:
SELECT request_session_id spid, OBJECT_NAME (resource_associated_entity_id) tableNameFROM sys.dm_tran_locksWHERE resource_type = 'OBJECT' ORDER BY request_session_id ASC--spid locking table process-- tableName locked table name
-- query the SQL statement of the corresponding process interlock according to the locking table process
DBCC INPUTBUFFER (249)
-- unlock:
DECLARE @ spid INT SET @ spid = 52 Muir-Table Lock process DECLARE @ SQL VARCHAR (1000) SET @ SQL = 'kill' + CAST (@ spid AS VARCHAR) EXEC (@ SQL)
-- generate an unlocked SQL
SELECT DISTINCT 'DECLARE @ spid INT SET @ spid =', request_session_id,' DECLARE @ SQL VARCHAR (1000) SET @ SQL =''kill''+ CAST (@ spid AS VARCHAR) EXEC (@ SQL);'as sFROM sys.dm_tran_locksWHERE resource_type = 'OBJECT'-- spid Table Lock process-- tableName locked Table name above is all the contents of the article "sqlserver query locking sql and unlocking methods". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.