пример:
X++:
CCADOConnection cn;
CCADOCommand command;
CCADOCommand cmTTSBegin;
CCADOCommand cmTTSCommit;
CCADOCommand cmUpdate;
;
cn = new CCADOConnection();
command = new CCADOCommand();
cmUpdate = new CCADOCommand();
cmTTSCommit = new CCADOCommand();
cmTTSBegin = new CCADOCommand();
cn.open(strfmt("DRIVER=SQL Server;Server=%1;UID=%2;PWD=%3;DataBase=%4", ServerName, UserId, Pasword, DataBaseName));
command.activeConnection(cn);
cmTTSBegin.activeConnection(cn);
cmTTSCommit.activeConnection(cn);
cmUpdate.activeConnection(cn);
cmTTSBegin.commandText("BEGIN transaction");
cmTTSBegin.execute();
cmUpdate.commandText(strfmt("Update %1 set %2 = %2 + 1", TableName, Field));
cmUpdate.execute();
cmTTSCommit.commandText("COMMIT Transaction");
cmTTSCommit.execute();