Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Hi Christopher,
Ultimately, the Tx will need to be managed by SQL Server, because that is where the activity is occuring.
The best way to handle this with SPT since your title references Stored Procedures.
The first step establish a connection to SQL. Once you have done that, you will want to issue a SQLSetProp() against the connection handle to tell ODBC you will handle the Tx's manually.
Now, you can fetch your data. At this point, you can do whatever modifications you want on the client. Once you are ready to send your updates, spin through your client-side cursors and use the data as the basis of making your stored proc calls to either add/update/delete data. If any one of the procedures fails (remember, you can equip your stored procedures to send back an/several output parameter(s) to inform you whether things worked correctly) - again, if any of the calls fail, simply issue a SQLRollback(). Otherwise, issue a SQLCommit().
HTH
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