Sqltransaction Class vs StoredProcedure Transaction

sureshcd10

Well-known member
Joined
Dec 25, 2003
Messages
77
We can create transactions at the
-->codebehind level by making use of SqlTransaction class or in then
-->StoredProcedure level

so that we can create save point and Rollback a transaction whenever a transaction fails

Now my question is is there any specific advantage/disadvantage in using Sqltransaction at the Codebehind against using the same at the storedProcedure level.
I am using C# to develop aspx pages and SQLServer2000 as database
Which one is the best option and WHy ? :confused:

Thank u all in advance
 
Theres no "better" one, although the SqlTransaction object DOES provide you the ability to do other things within the context of a transaction (such as saving an image to the file system).
 
Jay1b said:
Stored procedures are precompiled into the database so they will run slightly faster.

I knew there was no pre-compilation for the stored procs. They are compiled when when they are used, just like any other query. The difference is that the execution (query) plan for the stored proc is easyer to retrieve from the cache (or at least this is what i know)
 
To a degree, stored procedures are at least partially precompiled and will run faster then standard queries in every case. (assuming all things are equal).
 
Jay1b said:
To a degree, stored procedures are at least partially precompiled and will run faster then standard queries in every case. (assuming all things are equal).

Is this true for the stored procedures that have parameters also ?
 
Back
Top