Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

ima
Posted
There's 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).
Posted
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)

Posted
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).
Posted
To a degree' date=' stored procedures [u']are[/u] 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 ?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...