1

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

0

1 Answer 1

5

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.