今天看啥
    热点:

      天发国际娱乐官网:  2、鸡蛋  鸡蛋含有丰富的优质蛋白质,能充分滋养毛囊。

      sqlserver:查询锁住sql以及解锁,sqlserversql


      --查看被锁表:
      SELECT
      request_session_id spid,
      OBJECT_NAME(
      resource_associated_entity_id
      ) tableName
      FROM
      sys.dm_tran_locks
      WHERE
      resource_type = 'OBJECT'
      ORDER BY request_session_id ASC
      --spid 锁表进程
      --tableName 被锁表名

      --根据锁表进程查询相应进程互锁的SQL语句
      DBCC INPUTBUFFER (249)

       

       

      -- 解锁:
      DECLARE
      @spid INT
      SET @spid = 52--锁表进程
      DECLARE
      @SQL VARCHAR (1000)
      SET @SQL = 'kill ' + CAST (@spid AS VARCHAR) EXEC (@SQL)

       

      --生成解锁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 s
      FROM
      sys.dm_tran_locks
      WHERE
      resource_type = 'OBJECT' --spid 锁表进程
      --tableName 被锁表名

      www.1click-soft.comtruehttp://www.1click-soft.com/Sql_Server/1229063.htmlTechArticlesqlserver:查询锁住sql以及解锁,sqlserversql --查看被锁表: SELECT request_session_id spid, OBJECT_NAME( resource_associated_entity_id ) tableName FROM sys.dm_tran_lo...

      相关文章

      相关搜索: sqlserver

      帮客评论

      视觉看点
      百度 360 搜狗