• Carlo Romagnano (11/22/2010)


    Any user can view sysobjects in tempdb:

    Open session ONE:

    create table #a(i int)

    select name,id from tempdb.dbo.sysobjects where name like '#a%'

    Open session TWO with same or another user:

    create table #a(i int)

    select name,id from tempdb.dbo.sysobjects where name like '#a%'

    I ran these scripts on a test server (I'm not a sysadmin of that server) and got the following results (underscore characters are truncated).

    Session 1:

    name id

    -------------------------- -----------

    #a____________0000000648F9 756038366

    Session 2:

    name id

    -------------------------- -----------

    #a____________0000000648FA 772038423

    The version of the SQL Server:

    SELECT @@VERSION

    Microsoft SQL Server 2005 - 9.00.4053.00 (Intel IA-64) May 26 2009 14:15:40 Copyright (c) 1988-2005 Microsoft Corporation Developer Edition (64-bit) on Windows NT 5.2 (Build 3790: Service Pack 1)