Solved

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

Posted on 2011-02-23
13
266 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 32

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
 

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 32

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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 32

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 32

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 32

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

This article describes some very basic things about SQL Server filegroups.
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…

744 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

10 Experts available now in Live!

Get 1:1 Help Now