Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to use BEGIN TRANSACTION with Sql Passthrough
Message
De
16/09/2004 07:23:15
 
 
À
16/09/2004 07:06:59
Suhas Hegde
Dental Surgeon
Sirsi, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00942755
Message ID:
00942822
Vues:
22

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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform