Non Temp Temp Tables

  • Comments posted to this topic are about the item Non Temp Temp Tables

  • Easy on, thanks!

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Easy one, thanks πŸ™‚

    Thanks

  • Easy One. πŸ™‚

    But i think it is rather unusual, tempdb is completely wiped out whenever the SQL Server service restarts. Yes or No?

  • Sreepathi1987 (7/21/2014)


    Easy One. πŸ™‚

    But i think it is rather unusual, tempdb is completely wiped out whenever the SQL Server service restarts. Yes or No?

    The answer is Yes.

    Nice and easy question, but still tricky if you have never created a table in tempdb before. So Thanks for sharing Steve.

  • Sreepathi1987 (7/21/2014)


    Easy One. πŸ™‚

    But i think it is rather unusual, tempdb is completely wiped out whenever the SQL Server service restarts. Yes or No?

    Yes, which makes tempdb useful as an experimental sandbox. If you forget to clear up your tables, SQL Server will do it for you.

    β€œWrite the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden

  • This was removed by the editor as SPAM

  • easy one on monday morning πŸ™‚

  • ChrisM@Work (7/21/2014)


    Sreepathi1987 (7/21/2014)


    Easy One. πŸ™‚

    But i think it is rather unusual, tempdb is completely wiped out whenever the SQL Server service restarts. Yes or No?

    Yes, which makes tempdb useful as an experimental sandbox. If you forget to clear up your tables, SQL Server will do it for you.

    Now the question becomes useful for me. Thanks..

  • Sreepathi1987 (7/21/2014)


    Easy One. πŸ™‚

    But i think it is rather unusual, tempdb is completely wiped out whenever the SQL Server service restarts. Yes or No?

    Mostly yes.

    If there is corruption in tempdb, that corruption will persist after a service restart. At that point, you have to manually drop tempdb files.

    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

  • Nice, and not so easy for me that I didn't have to think, but still easy enough for a Monday. And brought up an interesting point or two. Thanks Steve.

    [font="Verdana"]Please don't go. The drones need you. They look up to you.[/font]
    Connect to me on LinkedIn

  • Creating permanent tables in tempdb this way is tricky. They will behave "sort of" like permanent tables (they will not be removed when the batch ends or when you leave the scope), but they will not really be permanent in that they will be loist when the box restarts. (Or fails over in the case of a box that is part of a high availability setup).

    ChrisM@Work (7/21/2014)


    Sreepathi1987 (7/21/2014)


    Easy One. πŸ™‚

    But i think it is rather unusual, tempdb is completely wiped out whenever the SQL Server service restarts. Yes or No?

    Yes, which makes tempdb useful as an experimental sandbox. If you forget to clear up your tables, SQL Server will do it for you.

    Beware of putting too much trust in this sandbox. Especially for tuning, tempdb is not a good place to try. Various features of the optimzed are not used in tempdb! (I know because I have been bitten by this often enough that I now, finally, remember. Most of the time).


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/

  • So you return from being gone and you give us a real easy one to lull us to sleep, and tomorow, WHAM! We must watch out for this.

    πŸ™‚

    M...

    Not all gray hairs are Dinosaurs!

  • Thanks for an easy one, Steve!

  • Welcome back, Steve. Thank you for treating us gently on your return! πŸ˜€

    Sean

Viewing 15 posts - 1 through 15 (of 22 total)

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