tempdb and permaent tables

  • Hi all

    I have created some permenent tables(mistake) tables in temp db. But can not view them in managment studio. How do i view and delete them all?

  • select *

    from tempdb.sys.objects

    that will list all of the objects in tempdb.

    If you have restarted sql server since creating those tables then those tables are gone now.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • SELECT name from tempdb.sys.objects

    _______________________________________________________________
    To get quick answer follow this link:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

  • You should be able to see it from within object explorer in management studio, if that's what you would prefer.

    Go to your server node within object explorer -> Databases -> System Databases -> tempdb -> Tables

    As has been already been pointed out, they are no more if Sql Server has since been restarted.

  • Wouldn't worry to much

    you can find them as people mention above, but the tempdb is recreated every time the sql instance is restarted so they won't be there forever.

    Dont just delete all the table the queries about produce though, the below will remove all that aren't MS/System created and should give a clearer view.

    SELECT name from tempdb.sys.objects where OBJECTPROPERTYEX(object_id,'ismsshipped') = 0

  • Krishna1 (7/30/2013)


    Hi all

    I have created some permenent tables(mistake) tables in temp db. But can not view them in managment studio. How do i view and delete them all?

    Have you tried to refresh the view?

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply