1

i have cloud based solutions (azure function, which reads json from service bus and convert to c# object) which inserts data into on prem sql server with multiple insert statements, are sql transactions reliable and secure over the internet.

what if connection fails during insertion in to database.

user1222614
  • 91
  • 1
  • 1
  • 3

1 Answers1

1

When connection fails during insertion, transaction is not complete and no rows are inserted.

When you call INSERT inside transaction, no rows are inserted until you call COMMIT TRANSACTOIN. If you use EF and transaction is not commited on end of using block, rollback is called automatically.

This is one of the typical scenario the transactions are designed for.

Honza K.
  • 113
  • 8