Connect to an existing transaction on SQL Server using C#
Maybe this question is a little far-fetched but i'll give it a shot..
Can i connect to an ongoing tran开发者_运维问答saction in some way? The problem is that i have [C++ Program A] that does various operations on a database and then calls [C# Program B] that does more operation on the same database. I want all those operations from both programs to run in a single transaction - thus allowing rollback for example.Is it somehow possible?
Thanks.
No. Transactions are per-connection (in SQL Server, at least).
What you can do is to have a distributed transaction, which will be fully ACID.
精彩评论