Home » none » Tracking down SQL Server Connection Issue

Tracking down SQL Server Connection Issue

Same client as yesterday, but new problem.

Today, they finally got the new parts they needed to get their SQL server back up and running.  Which was the main problem that caused yesterday’s question.  Only, the web server(s) could not connect to the SQL server.

So, of course, the client had checked all the obvious stuff before they called me, and when they finally called me, I checked all the obvious stuff.  Everything looked like it was configured just the same as it was two days ago.  What they heck could be the problem?

Well, the next obvious test is can I connect to the same IP address when I’m on the computer that the database is on.  ie, can the sql server computer connect to the sql server using the same settings we are trying to use from the outside.

The answer to that question was "No."

But why?  Now, it’s time for some serious tracking.  So, here’s what I did.

First, can I telnet to localhost using the port that sql is connected on?

Yep.  That works.

Can I connect using telnet to the IP address and port number?

Nope.

How about the other network cards?

Yep the other cards and IP addresses work.

So, then I asked, "Has anyone rebooted this computer yet?  Or at least restarted the SQL server?"

No one had.  So, we restarted the SQL service and everything magically started working.

Moral to this story.  When something isn’t working, first, try a reboot.

BTW, you can track down just about any connection problem to anything that uses TCP, by using telnet.  Get into the console window and type:

telnet serverNameOrIpAddress portNumber

where serverNameOrIpAddress is the actual server you want to test and portNumber is the port the service is listening on.  You’ll get an error message if you can’t connect.  Otherwise, depending on the service, you’ll either get a blank screen or you’ll get some response from the server.

Like this Article? Subscribe to get every article sent to your email.

Related Post

  • MSSQL CREATE TABLE – SQL For ProgrammersMSSQL CREATE TABLE – SQL For Programmers Once you have your database created, you'll want to get some tables set up into it.  To do this, you'll need the CREATE TABLE statement that can be issued from the connection object once […]
  • The easiest way to create a SQL db from CodeThe easiest way to create a SQL db from Code (We'll get back to the series on Reflection next week.) So, I've started experimenting with replacing my TestComplete test scripts with CSharp test scripts.  This shouldn't be too big […]
  • Some days, technology is more trouble than it’s worth.Some days, technology is more trouble than it’s worth. As I sit down to write this morning, thinking about what I could write that would be valuable to you, the only thing I can think is, “Blah, I have nothing in me.” But why is this?  […]
  • Silverlight – Databinding to a Web ServiceSilverlight – Databinding to a Web Service In the last several posts, I’ve demonstrated various ways of getting data onto the screen.  What I’ve purposely omitted up until this point is how to update this information. So […]
  • Document/View All Over Again…Document/View All Over Again… Back when we programmed in C++ using the Microsoft Foundation Classes (MFC) we had a framework that we programmed in called "Document/View." The question I keep asking myself as I think […]

About Dave Bush

Dave Bush is a Full Stack ASP.NET developer. His commitment to quality through test driven development, vast knowledge of C#, HTML, CSS and JavaScript as well as his ability to mentor younger programmers and his passion for Agile/Scrum as defined by the Agile Manifesto and the Scrum Alliance will certainly be an asset to your organization.