• crmitchell (7/25/2014)


    Lynn Pettis (7/25/2014)


    crmitchell (7/25/2014)


    Coderx7 (7/24/2014)


    Difference between SQL Server and Oracle.

    If you want to treat the loop inserting 1000 rows of data as a single transaction in SQL Server you need to explicitly define the transaction.

    BEGIN TRANSACTION

    your 1000 iteration loop

    COMMIT TRANSACTION

    Now, if you kill the process running this while still in the look, all rows entered up to the point you kill the process will be rolled back.

    except that my namesake's suggestion was to replace

    your 1000 iteration loop

    with

    single 1000 record insert using tally table

    which would be rolled back in its entirety by the implicit transaction failing

    Yes. If that single 1000 row insert was terminated while being insert the entire transaction would be rolled back.