transaction test!

  • good question. Just-in-time I remembered, table variables do not participate in transactions.

  • Very good question

    If you change the line:

    DECLARE #test TABLE (id int, pname varchar(100))

    to

    create table #test (id int, pname varchar(100))

    it will return zero rows - which was what I thought it would do - 🙁

  • I think this is great behavior. Allows you to easily log things that might happen in a transaction that needs to roll back. If you used a permanent table, your logging would be lost.

  • Hi Steve,

    that (logging) I was doing a lot in the past project - and I was missing the point too :crazy:

    Every time I tell this fact to customers (e.g. the ones, who was calling me with nearly empty log tables) I know that but was failing.

    The best question for a long time. Clear focus, seems easy, but have to read VERY vcarefully.

Viewing 4 posts - 16 through 18 (of 18 total)

You must be logged in to reply to this topic. Login to reply