• subscribe
August 19, 2003 12:00 AM

Verifying Database Connections

SQL Server Pro
InstantDoc ID #39720

I have a Visual Basic (VB) application that connects to a SQL Server 2000 database. How can I verify that the client machine has a TCP/IP sockets Net-Library connection to the database?

You can easily determine the Net-Library that a particular connection is using by looking at the sysprocesses table's net_library column in the master database. The master..sysprocesses table contains one row for each connection to the server; a server process ID (SPID) identifies each connection. The following query returns the Net-Library that the connection is using:

SELECT net_library FROM master..
sysprocesses WHERE spid = @@spid

Running this T-SQL query from your application lets you determine which Net-Library a connection from your application is using. Of course, you can also manually inspect the sysprocesses table from Query Analyzer to get the information you're looking for. TCP/IP will be the value for the net_library column if you're connected through a TCP/IP sockets connection.



ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here
  • SP1?
    I know there is a SP1 for SQL 2008 R2 available....and there is a "feature pack" as well... ...
  • SQL database mirroring
    I have SQL Server 2008 R2 Enterprise 64bit on Windows 2008 R2 Enterprise 64bit.  Each SQL Server has...
  • Dell Compellent Disk Drive
    Does anybody has experience with Dell Compellent Disk Drive? Basically, this system manages all disk...
  • Sql server performance tuning
    I need to find a tool that help me to optimize sql server,queries,improve the performance and solve ...