Why do LocalTemp table showing with lengthy underscore under Temporary Tables of tempdb in SSMS 2017 Express Edition? [duplicate]

dba.stackexchange https://dba.stackexchange.com/questions/219136

문제

In my Microsoft SQL Server 2017 Express Edition, I have created a local temp table using below create statement,

create table #localtemptable
(tempid int,tempname varchar(20) )

After creating #table, I checked the tempdb -> Temporary Table , it is showing the table name along with a lengthy underscore and 0000000004 number. What is it meaning and why it is showing like this?

enter image description here

도움이 되었습니까?

해결책

The lengthy underscore followed by the number were added by the engine to your requested table name in order to make the table name globally unique in the tempdb database. You can query your local table in the session that created it using the #localtemptable name that you gave it. What you are seeing is perfectly normal behavior and there's nothing to be alarmed about.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 dba.stackexchange
scroll top