I am confused about the usage of global temporary table. I have created a global temporary table
//Session 52 : Creator Session
Create Table ##temp(i int)
Insert Into ##temp(i) Values(1),(2),(3)
Select * From ##temp
//Session 56
Select * From ##temp
//Session 57 : last session which holds the refference of ##temp
Select * From ##temp
Now if I close the Session 52, the ##temp table destroys.
I believe global temp table released in the following cases
- It's explicitly removed by any sessions
- The creator session closed and there is no other sessions referencing this session.
I am confused about sessions referencing this session(creator Session) what does this mean ?