SQL Server Performance

Temporary table

Discussion in 'General Developer Questions' started by vietcave, Jul 25, 2005.

  1. vietcave New Member

    Hi everyone,

    I create a temporary table:

    CREATE TABLE #T(id int)

    I read Books Online. It says that my temporary table must be in tempdb database. But I can't find it in tempdb.

    Where is it?

    Thanks
  2. Madhivanan Moderator

    This will tell you

    Select * from tempdb..sysobjects where name like '#t%'


    Madhivanan

    Failing to plan is Planning to fail
  3. satya Moderator

    Temporary tables are usually pretty quick. Since you are creating and deleting them on the fly, they are usually only stored in memory and never make it to disk. This table is only visible upto that session of SQL Server.

    Satya SKJ
    Moderator
    http://www.SQL-Server-Performance.Com/forum
    This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
  4. vietcave New Member

    Thanks.

    I now find my temporary table. It is in sysobjects in tempdb.

    Thanks you very much.

Share This Page