--查询已锁的表 select request_session_id spid,OBJECT_NAME(resource_associated_entity_id) tableName ,* from sys.dm_tran_locks where resource_type='OBJECT' --解锁表(@spid) declare @spid int Set @spid = 62 --锁表进程 declare @sql varchar(1000) set @sql='kill '+cast(…
--查看锁表: select request_session_id spid,OBJECT_NAME(resource_associated_entity_id) tableName from sys.dm_tran_locks where resource_type='OBJECT' --解锁: declare @spid int Set @spid = 57 --锁表进程 declare @sql varchar(1000) set @sql='kill '+cast(@spid as va…
SELECT 表名 then d.name else '' end, 表说明 then isnull(f.value,'') else '' end, 字段序号=a.colorder, 字段名=a.name, 标识 then '√'else '' end, 主键 FROM sysobjects where xtype='PK' and name in ( SELECT name FROM sysindexes WHERE indid in( SELECT indid FROM sysindexk…
;with cte as ( select * from Associator where No = 'mc1007' union all select air.* from Associator as air inner join cte on air.ParentNo = cte.No ) select * from cte;…