diff --git a/ShowBuildMenu.bat b/ShowBuildMenu.bat
index 29fe9622a7b..38ed467ae77 100644
--- a/ShowBuildMenu.bat
+++ b/ShowBuildMenu.bat
@@ -57,12 +57,14 @@ echo F. Add a test configuration for Oracle with managed driver.
echo G. Add a test configuration for SQL Server Compact.
echo H. Add a test configuration for MySql.
echo I. Add a test configuration for SAP HANA.
+echo J. Add a test configuration for SAP SQL Anywhere.
echo.
echo X. Exit to main menu.
echo.
-%BUILDTOOL% prompt ABCDEFGHIX
-if errorlevel 9 goto main-menu
+%BUILDTOOL% prompt ABCDEFGHIJX
+if errorlevel 10 goto main-menu
+if errorlevel 9 goto test-setup-anywhere
if errorlevel 8 goto test-setup-hana
if errorlevel 7 goto test-setup-mysql
if errorlevel 6 goto test-setup-sqlserverce
@@ -136,6 +138,13 @@ set LIB_FILES=
set LIB_FILES2=
goto test-setup-generic
+:test-setup-anywhere
+set CONFIG_NAME=SapSQLAnywhere
+set TEST_PLATFORM=AnyCPU
+set LIB_FILES=
+set LIB_FILES2=
+goto test-setup-generic
+
:test-setup-generic
set CFGNAME=
set /p CFGNAME=Enter a name for your test configuration or press enter to use default name:
@@ -221,12 +230,14 @@ echo I. NHibernate Trunk - Oracle Managed (64-bit)
echo J. NHibernate Trunk - SQL Server Compact (32-bit)
echo K. NHibernate Trunk - SQL Server Compact (64-bit)
echo L. NHibernate Trunk - SQL Server ODBC (32-bit)
+echo M. NHibernate Trunk - SAP SQL Anywhere
echo.
echo X. Exit to main menu.
echo.
-%BUILDTOOL% prompt ABCDEFGHIJKLX
-if errorlevel 12 goto main-menu
+%BUILDTOOL% prompt ABCDEFGHIJKLMX
+if errorlevel 13 goto main-menu
+if errorlevel 12 goto teamcity-anywhere
if errorlevel 11 goto teamcity-sqlServerOdbc
if errorlevel 10 goto teamcity-sqlServerCe64
if errorlevel 9 goto teamcity-sqlServerCe32
@@ -312,5 +323,11 @@ move "%CURRENT_CONFIGURATION%" "%CURRENT_CONFIGURATION%-backup" 2> nul
move "%CURRENT_CONFIGURATION%-backup" "%CURRENT_CONFIGURATION%" 2> nul
goto main-menu
+:teamcity-anywhere
+move "%CURRENT_CONFIGURATION%" "%CURRENT_CONFIGURATION%-backup" 2> nul
+%NANT% /f:teamcity.build -D:skip.manual=true -D:CCNetLabel=-1 -D:config.teamcity=sqlanywhere
+move "%CURRENT_CONFIGURATION%-backup" "%CURRENT_CONFIGURATION%" 2> nul
+goto main-menu
+
:end
popd
diff --git a/lib/teamcity/SapSQLAnywhere/SQLAnywhere_installation.txt b/lib/teamcity/SapSQLAnywhere/SQLAnywhere_installation.txt
new file mode 100644
index 00000000000..2c93b30c7cb
--- /dev/null
+++ b/lib/teamcity/SapSQLAnywhere/SQLAnywhere_installation.txt
@@ -0,0 +1,14 @@
+Installation steps for SAP SQL Anywhere 17 for NH TeamCity:
+1. Download SAP SQL Anywhere 17 from https://www.sap.com/products/sql-anywhere.html.
+ Please make sure you comply with it's license.
+
+2. Run the installer
+3. Ensure the MSDTC Windows service is enabled. All transaction scope tests, even
+ those normally not distributed, use it with SAP SQL Anywhere 17
+
+The NHibernate.TestDatabaseSetup should normally do on its own the following operations:
+1. Create the test database with default options
+2. Run the query
+ set option ansi_update_constraints = 'Off'
+ (Otherwise some tests will fail.)
+
diff --git a/src/NHibernate.Config.Templates/SapSQLAnywhere.cfg.xml b/src/NHibernate.Config.Templates/SapSQLAnywhere.cfg.xml
new file mode 100644
index 00000000000..9512fef12d6
--- /dev/null
+++ b/src/NHibernate.Config.Templates/SapSQLAnywhere.cfg.xml
@@ -0,0 +1,21 @@
+
+
+
+
+ NHibernate.Driver.SapSQLAnywhere17Driver
+
+
+ UID=DBA;PWD=sql;Server=localhost;DBN=nhibernate;DBF=c:\nhibernate.db;ASTOP=No;Enlist=false;
+
+ NHibernate.Dialect.SybaseSQLAnywhere12Dialect
+ true=1;false=0
+
+
diff --git a/src/NHibernate.DomainModel/ABCProxy.hbm.xml b/src/NHibernate.DomainModel/ABCProxy.hbm.xml
index 92e85cb547f..1edb5eff84f 100644
--- a/src/NHibernate.DomainModel/ABCProxy.hbm.xml
+++ b/src/NHibernate.DomainModel/ABCProxy.hbm.xml
@@ -10,8 +10,8 @@
-
-
+
+