Solved

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

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

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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
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…

910 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

22 Experts available now in Live!

Get 1:1 Help Now