ODBC Server Reference Manual

Transact-SQL Language
HP NonStop ODBC Server Reference Manual429151-002
4-47
Examples
In SQL Server, transaction names are needed when transactions are nested;
however, since 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, the transaction is committed even
if the transaction-name does not match the transaction-name on the
previous BEGIN TRANSACTION statement. No error or warning messages are
issued.
Examples
The following transaction creates a table and inserts one row:
begin transaction
use test_disk01_persnl
create table employee
(employee_number smallint not null,
first_name char(15) not null,
last_name char(20) not null,
deptnum smallint not null,
job_code smallint not null,
salary money null)
insert into employee
(empnum, first_name, last_name, deptnum,
jobcode, salary)
values (2001, "Dana", "Hall", 1010, 3001, 40000)
commit transaction
NonStop ODBC Server Compared With SQL Server
When used through the NonStop ODBC Server, COMMIT TRANSACTION differs from
the SQL Server implementation in the following ways:
Feature In SQL Server
In Programs Used With the NonStop
ODBC Server
Are transaction names
allowed?
Yes Yes, but they are ignored
Are nested transactions
allowed?
Yes No
Are transaction
savepoints allowed?
Yes Yes, but they are ignored.
Are DDL operations on a
table allowed within a
transaction?
No Yes, if the table is audited
See DDL Statements Allowed in User-
Defined Transactions on page 4-3.