• UMG Developer (10/5/2010)


    Nice question, thanks!

    Related BOL links:

    SQL Server 2008 R2: http://msdn.microsoft.com/en-us/library/ms175010.aspx

    SQL Server 2008: http://msdn.microsoft.com/en-us/library/ms175010(SQL.100).aspx

    SQL Server 2005: http://msdn.microsoft.com/en-us/library/ms175010(SQL.90).aspx

    SQL Server 2000: http://msdn.microsoft.com/en-us/library/aa260638(SQL.80).aspx

    All of them say:

    * "Transactions involving table variables last only for the duration of an update on the table variable. Therefore, table variables require less locking and logging resources."

    * "... because table variables have limited scope and are not part of the persistent database, they are not impacted by transaction rollbacks."

    I think that pretty much says that table variables don't fully participate in transactions, and can't be rolled back. (I was expecting to find something that said variables don't participate in transactions, but I never found that.)

    Thanks for your support and providing the great links.

    I believe I could not get the supporting documentation for this question because I was looking for a reference to the fact that "variables don't participate in transactions" 🙂

    Thanks & Regards,
    Nakul Vachhrajani.
    http://nakulvachhrajani.com

    Follow me on
    Twitter: @sqltwins