Excel VBA Insert multiple records using all or nothing approach
Hi
I need to insert a few hundred records of data into a SQL database using an all or nothing (or transact rollback) approach.
What Excel VBA code would I use to do this?
DatabasesVBASQL
Last Comment
Murray Brown
8/22/2022 - Mon
Éric Moreau
how do you insert the records? By doing multiple INSERT statements? In that case surround the block of statements by BEGIN TRAN / COMMIT TRAN.
Check https://docs.microsoft.com/en-us/sql/t-sql/language-elements/begin-transaction-transact-sql?view=sql-server-2017