Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 temp table

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-05-27 : 08:19:39
¢ödêmån writes "Ok, here's an unusual one.

Does anyone know where SQL Server stores or gets the system- generated numeric suffix ?

e.g.
create table #x (id int)

and when you look in sysobjects

select * from tempdb..sysobjects where type = 'u'

this is what you get.

#x______________________________000000102330

that suffix will remain the same if you keep creating temp tables with the same session. so SQL Server must store or get that from somewhere right.

So if anyone with a bit more SQL Internals please share some light on this.

Cheers."

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-05-27 : 08:21:45
It's probably generated based on the connection's SPID. If you open another connection and create the same temp table, you'll get a different suffix. You might be able to determine how it creates the suffix, but it won't be that useful. You can't reference a temp table using its name and suffix anyway.

Go to Top of Page
   

- Advertisement -