diff --git a/src/Runtime/XSharp.VFP.Tests/MiscTests.prg b/src/Runtime/XSharp.VFP.Tests/MiscTests.prg
index b83d0f05c5..bf967357e0 100644
--- a/src/Runtime/XSharp.VFP.Tests/MiscTests.prg
+++ b/src/Runtime/XSharp.VFP.Tests/MiscTests.prg
@@ -353,6 +353,11 @@ BEGIN NAMESPACE XSharp.VFP.Tests
METHOD PColTest() AS VOID
Assert.Equal(0, PCol())
END METHOD
+
+ [Fact, Trait("Category", "Database")];
+ METHOD TxnLevelTest() AS VOID
+ Assert.Equal(0, TxnLevel())
+ END METHOD
END CLASS
END NAMESPACE
diff --git a/src/Runtime/XSharp.VFP/Database/DbFunctions.prg b/src/Runtime/XSharp.VFP/Database/DbFunctions.prg
index 161c4aa4ff..960313edd5 100644
--- a/src/Runtime/XSharp.VFP/Database/DbFunctions.prg
+++ b/src/Runtime/XSharp.VFP/Database/DbFunctions.prg
@@ -12,6 +12,13 @@ USING XSharp.RDD
USING System.Collections.Generic
USING XSharp.RDD.Support
USING XSharp.Internal
+
+/// Internal transaction nesting level.
+/// Incremented by BEGIN TRANSACTION, decremented
+/// by END TRANSACTION/ROLLBACK
+GLOBAL __FoxTnxLevel := 0 AS LONG
+
+///
///
///
///
@@ -554,6 +561,11 @@ FUNCTION Seek(uExpression, uWorkarea, uOrder) AS LOGIC CLIPPER
END IF
RETURN lResult
+///
+[FoxProFunction("TXNLEVEL", FoxFunctionCategory.Database, FoxEngine.SQL, FoxFunctionStatus.Full, FoxCriticality.High)];
+FUNCTION TxnLevel( ) AS LONG
+ RETURN __FoxTnxLevel
+
FUNCTION DbCopyStructFox(cTargetFile, aFields, lCdx) AS LOGIC CLIPPER
local acStruct as ARRAY
IF IsArray(aFields)
diff --git a/src/Runtime/XSharp.VFP/ToDo-TUVWX.prg b/src/Runtime/XSharp.VFP/ToDo-TUVWX.prg
index 7a655cc4aa..4ee80ded1c 100644
--- a/src/Runtime/XSharp.VFP/ToDo-TUVWX.prg
+++ b/src/Runtime/XSharp.VFP/ToDo-TUVWX.prg
@@ -19,14 +19,6 @@ FUNCTION TableUpdate( nRows , lForce , uArea , cErrorArray) AS LOGIC
THROW NotImplementedException{}
// RETURN FALSE
-
-/// -- todo --
-///
-[FoxProFunction("TXNLEVEL", FoxFunctionCategory.Database, FoxEngine.SQL, FoxFunctionStatus.Stub, FoxCriticality.High)];
-FUNCTION TxnLevel( ) AS LONG
- THROW NotImplementedException{}
- // RETURN 0
-
/// -- todo --
///
[FoxProFunction("TXTWIDTH", FoxFunctionCategory.UIAndWindow, FoxEngine.UI, FoxFunctionStatus.Stub, FoxCriticality.Medium)];