Enable two phase commit / 2pc on SQL Server
You have a Microsoft SQL Server and you wonder if it is possible to enable a two phase commit / 2pc in SQL Server?
First a short answer, yes it is!
With the SQL Server you need to enable the Microsoft Distributed Transaction Coordinator (DTC) Service which is typically disabled or set to manual startup. To enable it go to the Service management of your windows. Easiest way to get the Service management started is to type services.msc in your start menu of windows or at the command line.
Depending on the Windows version and on the SQL Server version you may do additional steps to enable the SQL Server for a full XA. Please check the documentation of your current SQL Server version on the MSDN, which explains it pretty well how to setup a SQL Server.
Also take note that you have to copy in some cases also files around to enable the full DTC for usage with JDBC.
Also you will need the matching JDBC XA drivers for your MS SQL Server version, which is also available on the MSDN.
But the best way:
switch to a open source database like PostgreSQL and pay the community some money of the saved license costs to keep great databases in open source development ;-)