Solved

How to Check & Validate ans Ms SQL 2000/2005 connection

Posted on 2011-02-23
13
268 Views
Last Modified: 2012-05-11
We have found that our apps gets disconnected random.  

How can I check the continuity with an SQL connection?  
0
Comment
Question by:rayluvs
  • 7
  • 5
13 Comments
 
LVL 32

Accepted Solution

by:
ewangoya earned 84 total points
ID: 34963059

That is a function of your application. Add code to your application to verify the connection
0
 

Author Comment

by:rayluvs
ID: 34963276
The application are various and are not developed by us.

Is there a CMD command like PING or another command that can verify this?
0
 
LVL 33

Assisted Solution

by:ste5an
ste5an earned 416 total points
ID: 34968587
As ewangoya wrote, a connection or session is application specific, so only the application can determine if the connection or session is still valid. This question has the same quality as "Is this computer connected to the internet?"

You can use SQLCMD

http://msdn.microsoft.com/en-us/library/ms180944.aspx

to check whether you can establish a conection. But this information is pretty worthless, after a disconnect/reconnect happened.  The only thing you can do, is to measure network stability in general.

btw, the connection is not made over any kind of WLAN/WiFi technology?

mfG
--> stefan <--
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

Author Comment

by:rayluvs
ID: 34969786
The connections is wired.

By what you are stating, that means that is not possible for SQL to loose connection if there is valid LAN connection?

There is no way to test an SQL connection continuously like    "PING XXX.XXX.XXX -t"

We have left running  "PING XXX.XXX.XXX -t" on the PCs to see if its LAN and the apps randomly hangs giving errors like tables not found, etc. even though the LAN is ok and the PING is giving correct connection results.
0
 
LVL 33

Assisted Solution

by:ste5an
ste5an earned 416 total points
ID: 34970222
Basically speaking, yes. Replace valid with stable, then yes. As TCP/IP can handle the normal problems on the wire.

The PING results cannot measure the quality of your connection, especially as ICMP is a different protocol. So this a pretty worthless information as it only states the you can make IPv4/IPv6 connection to the host.
0
 

Author Comment

by:rayluvs
ID: 34970485
Understood.  So how can I chack or validate an SQL connection?
0
 
LVL 33

Assisted Solution

by:ste5an
ste5an earned 416 total points
ID: 34970783
Form the client side: you can't. Form the server side, you can use e.g.
EXEC sp_who

Open in new window

and a lot of the System views in

http://msdn.microsoft.com/en-us/library/ms188068.aspx
0
 

Author Comment

by:rayluvs
ID: 34970870
But thats a Query Analyzer statement and the clients don't have SQL installed, they only have an ODBC connection.

I need to verify the communication between clients and SQL server.

There has to be a tool for this
0
 
LVL 33

Assisted Solution

by:ste5an
ste5an earned 416 total points
ID: 34971260
I like to repeat myself: It is not possible, when not done by the application itself.
0
 

Author Comment

by:rayluvs
ID: 34971442
Please excuse my ignorance in the topic, but I understand now: there is no way via a tool or command prompt to verify the communication between clients and SQL server.

Now by your comment, when done by the application itself, there is a way to verify the communication between clients and SQL server?  By that I understand that we can program an application to  verify the communication between clients and SQL server?

0
 
LVL 33

Assisted Solution

by:ste5an
ste5an earned 416 total points
ID: 34971645
This has nothing to with ignorance. You can only tell if a connection is working if you can inspect all involved components at once. This is under most circumstances not possible, thus you cannot determine whether a connection is working or not.

The only thing which can be done, can be done only by you application which fails randomly. This application can send a nonsense select like SELECT @@Version ; to the server and evaluate if it works or not. When it fails it must implement a reconnect.

This cannot be done by an additional application.
0
 

Author Comment

by:rayluvs
ID: 34971777
understood.
0
 

Author Closing Comment

by:rayluvs
ID: 35005930
thanx
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now