Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
>
>Hi Fabio,
>Just curious
>
>Wouldnt this
>SQLEXEC(,'BEGIN TRAN;write command;COMMIT')>0
>be same as
>SQLEXEC(,'Insert ...')>0 since it executes in only one batch ?
>
>COuld U explain a bit ?
>
>Suhashegde
>
>
>If you can complete the transaction with a single batch
>( if the "write command" not required other feedback data from the client's application )
>then do it with a single batch.
>
>The
>SQLEXEC(,'BEGIN TRAN;write command;COMMIT')>0
>is like
>SQLEXEC(,'BEGIN TRAN')>0 AND SQLEXEC(,'write command')>0 AND SQLEXEC(,'COMMIT')>0
>but it is faster and the probability that it go ok is upper.
>
>If "write command" is a single T-SQL, then BEGIN TRAN;;COMMIT are implicit.
>
>Fabio
Would the above be usefull involving while updating bufferered changes ? I.e making a cursor updatable and then updating the cursor ?
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement