ODBC Server Reference Manual
Transact-SQL Language
HP NonStop ODBC Server Reference Manual—429151-002
4-80
Example
transaction-name
is the name associated with the transaction.
In SQL Server, transaction names are needed when transactions are nested;
however, because transactions cannot be nested in programs used with the
NonStop ODBC Server, the transaction-name is not meaningful in these
programs.
When used through the NonStop ODBC Server, if the transaction-name does
not match the transaction-name on the previous BEGIN TRANSACTION
statement, an error message is issued and the transaction is not rolled back.
If transaction-name is not specified, the transaction in progress is rolled back.
savepoint-name
is not supported. The NonStop ODBC Server does not distinguish between a
transaction-name and a savepoint-name.
Example
The following transaction creates a table and inserts a row but rolls back before the
transaction is completed:
use test_disk01_persnl
begin transaction
create table employee
(empnum smallint,
first_name char(15),
last_name char(20),
deptnum smallint null,
jobcode smallint null,
salary float null)
insert into test_disk01_persnl..employee
(empnum, first_name, last_name, deptnum, jobcode, salary)
values (1234, "Georgia", "Brown", 1001, 3004, 52300)
insert into test_disk01_persnl..employee
(empnum, first_name, last_name, deptnum, jobcode, salary)
values (1234, "George", "Blue", 1002, 3002, 33500)
rollback transaction