Call multiple SQL Server stored procedures in a transaction

后端 未结 3 1005
太阳男子
太阳男子 2020-12-31 08:23

For usage in my current project I\'ve created a class that allows me to call SQL Server async.

My code looks like this:

internal class CommandAndCall         


        
3条回答
  •  误落风尘
    2020-12-31 08:49

    Yes, it is possible. Simply call SqlConnection.BeginTransaction before your first call, make you assign the returned SqlTransaction object to each SqlCommand.Transaction in the chain and call SqlTransaction.Commit() at the end.

提交回复
热议问题