• WayneS (6/15/2011)


    I've been doing some research into how temporary tables work in SQL Azure, and I have a few questions that I can't find answers for.

    My questions:

    1. Can you build a local temp table with a user-defined data type?

    nope

    2. Can you build a local temp table with a user-defined function?

    Nope, nope

    3. Can you build a local temp table with named constraints?

    Yep, that works.

    4. Is the collation of local temp tables that of tempdb, or of the current database?

    Not sure, how the heck do you check?

    5. Are the object_id values for local temp tables positive or negative?

    Positive for the one I tested.

    6. Is the local temp table built in tempdb, or the current database?

    Based on the query I had to run to get the object_id, it's in tempdb.

    Note that most of these are things that change when using a contained database in Denali, and I suspect that some of these are also changed in Azure.

    Thanks!

    Edit: and if you happen to have a link that documents any of these, that would be most excellent!

    Hope that helps. I got most of them.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning