• Another nice little tidbit of information about temporary tables in Denali: in all prior versions of SQL Server, through 2008R2, all temporary tables are created with positive object_id values. In Denali, local temporary tables are created with negative values (global temporary tables are still positive). I'm not sure of why the change... but if you are checking for existence of a temp table by: IF OBJECT_ID('tempdb..#table') > 0

    then you better start changing it to IF OBJECT_ID('tempdb..#table') IS NOT NULL.

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2