• Igor Micev - Wednesday, August 15, 2018 7:59 AM

    You can
    exec tempdb.dbo.sp_help '#temp'
    and you have all details about #temp

    Agreed.  And it's excellent for designing and troubleshooting.  It is, however, a bit difficult to automate if you're dealing with unknown inputs that are present in the Temp Table because you used SELECT/INTO to create the Temp Table and you need your code to be able to read the results so that it may make decisions about the data based on meta-data in the Temp Table. 

    As a bit of a sidebar, I think that its a shame that MS doesn't have a separate extended procedure that can actually be used to return an easily consumable meta-data table about any table.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)