Home Forums Programming General Question regarding the difference between two different ways to populate a new table in TSQL RE: Question regarding the difference between two different ways to populate a new table in TSQL

  • Jeff Moden (9/3/2014)


    Again, Gail will already know the reason for the performance boost in the second While Loop. I'm probably not using the right terminology but the simple explanation is that the log is only "commited" once in the second While Loop because of the explicit transaction instead of a million times like in the first While Loop (unless you have implicit transactions turned off, of course, and I don't recommend that).

    I think you mean autocommit mode, not implicit transactions; if implicit transactions were on instead of auto-ommit mode the first while loop would dtart a single transaction and that transaction would never be committed (until some code you havet included committed it).

    Tom