views:

824

answers:

1

When I connect to the SQL Server 2008 remotely it only works once, after that the server hangs. The service cannot be stopped or restarted and when trying to connect again it gives a 'Timeout' error.

The server has TCP/IP connections enabled. The default port is set to 1433 and I cleared the 0 from the dynamic ports. I enabled the 127.0.0.1 IP and the public IP and set the 1433 IP to them. Named pipes and the other protocol (Shared Memory or something) are disabled.

I am connecting from the remote machine using the 'sa' user and a strong password. The server is set to accept both authentication modes.

Connecting for the first time from the remote machine works perfect. Queries work and data can be retrieved from the databases. After disconnecting and trying to connect again it gives a timeout error. This error is generated because the SQL Server is hanged somewhere. At this point it is impossible to Stop or Restart the SQL Server service from the service machine. The only solution is to restart the computer. However, connecting to the server locally from SQL Management Studio still works.

I think it has something to do with going into an infinite loop somewhere, or it doesn't drop the connection on the 1433 port after disconnecting from the remote machine and it still waits for input from it.

+1  A: 

have you ruled out anything at the network layer such as software or hardware firewalls, NAT'ing, proxies ect?

Are you running SQL Server as a default or named instance?

if you do a netstat while things are working & then when you get a time out, what do you see?

Try running network monitor or wireshark on the server to see if the request is getting through & if so is the server responding?

EDIT: It's a bit of a concern that you can connect to the server on port 1433 when sql server isn't running you should be getting a connection refused (no firewall) or a timeout (with a firewall)

Run profiler on the server & audit logins/logouts you should be able to see the client connect? it may help you troubleshoot the issue?

Try a blunt instrument like re-installing the sql server connectivity driver eg. mdac, sql native on the client.

Nick Kavadias
1. The network works fine, otherwise it wouldn't connect at all. But it works once after every restart.2. Default instance.3. I can telnet into the server on the 1433 port both when the server is working and when it's not.4. I will try, but I doubt that this is the problem.
Ovi
1. Shouldn't it not work at all if this were the case?2. I tried reinstalling SQL on the server but still the same issue occurs. I will use the profiler to see what's what.3. I tried with multiple clients on different OS, all running the latest version of SQL 2008. Same thing happens every time.
Ovi
Do you have these issues if you connect locally to the server? I still think you have a network issues somewhere at a lower level
Nick Kavadias
Locally works all the time, even when remote connections no longer work. But what network problem could be there since it connects once?
Ovi
Nick Kavadias