I have a problem when I commit and rollback a transaction in SQL Server 2005.
I am developing an application (using C#.NET 3.5) that saves data into different seven tables in a database; one table relates with another table referencing foreign constraint.
When the data is inserted into one table, its unique id (primary key id) goes into another table as a foreign constraint. I have inserted the data making sql connection from C#.
The data inserts sequentially one after another from application, but I could not make inserts through one procedure only, so, I could not use commit and rollback concept here (as there are different procedure and data are inserting into one after another from application making each time connection for inserting).
Is there any way to apply commit and rollback method in this type of scenario?
Try surrounding all of your database updates code with