Connecting to the remote machine via the Terminal Services client, I ran this batch script on my SQL Server:
%windir%\System32\net.exe stop "SQLServerAgent"
%windir%\System32\net.exe stop "MSSQLServer"
%windir%\System32\net.exe start "MSSQLServer"
%windir%\System32\net.exe start "SQLServerAgent"
Now when I bring up a local web page (that connects to my SQL Server via ODBC) from my local browser, I get this error:
java.sql.SQLException: [Macromedia][SQLServer JDBC Driver]Error establishing socket. Connection refused: connect
And now when I try to connect to my SQL Server using my local copy of Enterprise Manager, I get this error:
A connection could not be established to MY_SQL_SERVER.
Reason: SQL Server does not exist or access denied.
I have no problem connecting to the remote machine via Terminal Services and running its copy of Enterprise Manager and connecting from there. I have no problem running a web page located on another server (that connects to my SQL Server via ODBC) from my local browser.
Unblocking Server Message Block Protocol (UDP) and exiting and shutting down my personal firewall has no effect. I can even see that MSTSC.EXE has been allowed to connect to my SQL Server via outbound TCP on remote port 3389 and that JAVAW.EXE have been allowed to connect to my SQL Server via outbound TCP on the MS SQL Server remote port.
I have done this before and there is a quick fix, but I can't remember what it is. I assumed it was just starting up the Distributed Transaction Coordinator (MSDTC) Service on the remote machine via the Terminal Services client, but that has no effect either. All three services in the MS SQL Server Manager are running as shown in the icon in the system tray on the remote machine as seen through the Terminal Services client.
How do I reconnect to my SQL Server?