欢迎投稿

今日深度:

学习笔记-数据库临时表 死锁解锁,

学习笔记-数据库临时表 死锁解锁,


临时表:以#开头,主要是为了防止锁表。

临时表一般在会话结束时。

创建的三种方式:

1)create table #tem

2)select * into #tem from table 

3)with #tem as(select * from table)

select * from #tem;

这是一种特殊的临时表,在查询结束后就会关闭。

 

查看死锁进程:

   select    
    request_session_id spid,   
    OBJECT_NAME(resource_associated_entity_id) tableName    
from    
    sys.dm_tran_locks   
where    
    resource_type='OBJECT' ;

杀死死锁进程: kill 354

www.htsjk.Com true http://www.htsjk.com/teradata/33626.html NewsArticle 学习笔记-数据库临时表 死锁解锁, 临时表:以#开头,主要是为了防止锁表。 临时表一般在会话结束时。 创建的三种方式: 1)create table #tem 2)select * into #tem from table  3)with #tem as(sel...
相关文章
    暂无相关文章
评论暂时关闭