• samsql (5/20/2010)


    yes saby i m gettin blocking in the tempdb.

    Grant there are procedure with begin and tran

    E.g

    proc ssa

    (

    Begin tran

    exec procedure1

    -----create some temp table and do some updation,insertion etc on temp table and physical table as there are more than 5 tables in each proc ...

    exec procedure2 -----create some temp table and do some updation,insertion etc on temp table and physical table as there are more than 5 tables in each proc ...

    exec procedure3-----create some temp table and do some updation,insertion etc on temp table and physical table as there are more than 5 tables in each proc ...

    commit

    run with diffrent sessions got the blocking while creating a temp table

    and one more thing is that the table creation takes 2 secs to create which is really more time.

    it destroy the table after the 1 procedure get fully exec till commit.

    Yes, that procedure that is calling all the other procedures will hold those temp tables in place until it completes. It doesn't matter that those procedures have transactions of their own, the wrapper proc acts as the main transaction and the temp tables will be held until it commits or rolls back.

    "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