User-2103114970 posted
SQL Server level
I normaly prefer SQL Server level transactions only when I need to update Multiple Tables, like I have a Master Table, and a Detail Table, I want to update both the Master and Detail tables.
First I need to insert one row to Master Table, then I need to get some other value from the inserted row, and need to update Detail table with the value.
.Net Level
And I used ADO.Net (.Net Level) transaction only for one project, it is an SQL 2008 project, there was some requirement like, I need to save some DOC files in Database, it is using a SQL 2008 feature, called FileStream. If enable FileStream it will create
some shared folder on the server, and Saves all the file data into this Folder, which can only read by SQL Server.
And the code is like
1) Insert the Filename into a Table.
2) Read the GET_FILESTREAM_TRANSACTION_CONTEXT
3) Read the Physical File
4) Write the Filecontents to SqlFileStream
To get the GET_FILESTREAM_TRANSACTION_CONTEXT, we need to use the Transaction in .Net level. There is some alternatives also found for the implementation, but we stick to this one.