--주의!!, 임시테이블명 끝에 '_'가 붙으면 안된다.
select 1 as a into #dsfajflsdaf
select left(name, charindex('______',name)-1)
from tempdb..sysobjects
where charindex('______',name) > 0
and xtype='u'
and not object_id('tempdb..'+ name) is null
Retrieved from http://blog.databaser.net/moniwiki/wiki.php/세션의임시테이블명리스트 last modified 2018-04-13 23:12:53