Nested Transaction Test Sample (SQL-file technology)

This sample demonstrates an example of transaction nesting (with help of "SAVE TRANSACTION […]" command).
Two stored procedures are located in "Procedures" subfolder: "NestedTransactionTest" and "NestedTransactionTest_2",
in corresponding SQL-files: ".NestedTransactionTest.sql" and ".NestedTransactionTest_2.sql".
Dot-prefix ('.') in file name obligates to include such file into "$sql_order.list" for group traslation of SQL-files.
In this order list ".NestedTransactionTest_2.sql" goes firts, then ".NestedTransactionTest.sql" goes (to concatenation).

Outer "NestedTransactionTest" procedure tries to invoke inner "NestedTransactionTest_2" SP.
The outer SP opens normal unnamed transaction through "BEGIN TRANSACTION" instruction (via "$(BEGIN_TRANSACTION_AUX)" macro).
The inner transaction opens named transaction by "SAVE TRANSACTION [NestedTransactionTest_2]" instruction of T-SQL.
Due to artificial error in named transaction it is explicitly rolled back by corresponding command
("ROLLBACK TRANSACTION [$(Procedure)]") in corresponding catch block,
that doesn't automatically rolls back the outer unnamed transaction.
The outer procedure catches error explicitly raised from the inner SP, shows error message and commits transaction(s)
after adding one more value into target table (integer numbers).
See corresponding files with SP code (in "Procedures" subfolder).
To perform the sample you have initially to translate them.

Transactions (in SP) operate with [_X_NUMBERS] table, this name is defined by "set ident_XNumbersTable=_X_NUMBERS" command,
in "@nested_transaction_test.cmd" (SQL-settings in UTF-8).
The table is created by translation of "(++) _X_NUMBERS.sql" script (it's required for successful sample execution).

Main script is in "nested_transaction_test.sql".
Table filling command is "nested_transaction_test.cmd".
The result is normally saved in "nested_transaction_test.txt", or may be seen as translation output in console window etc.

— — —