Udostępnij za pośrednictwem


Creating a Valid Connection String Using VIA Protocol

To create a valid connection string using Virtual Interface Adapter (VIA), you must provide each of the following elements:

  • Specify an Alias Name.
  • Provide the network interface card (NIC) number followed by a port number in the Via Parameters box. If left blank, VIA will attempt to connect to port <NIC#>:1433.
  • Specify VIA as the Protocol.
  • In the Server field, enter the server name or <servername>\<instancename> for a named instance.

At the time of connection, the SQL Native Client component reads the Server, Protocol, and Via Parameters values from the registry for the specified Alias Name, and creates a connection string in the format via:<servername> [\instancename],<nic number>:<port>.

Important

When two or more instances of Microsoft SQL Server are installed on the same computer, VIA connections can be ambiguous. When enabled, the VIA protocol attempts to use the TCP/IP settings, and listens on port 0:1433. For VIA drivers that do not allow configuration of the port, both instances of SQL Server will be listening on the same port. Incoming client connections can receive a connection to the correct server instance, the incorrect server instance, or be denied a connection, because the port is in use.

Verifying your Connection Protocol

The following query will return the protocol used for the current connection.

SELECT net_transport 
FROM sys.dm_exec_connections 
WHERE session_id = @@SPID;

Examples:

Connecting by server name:

Alias Name         ServerAlias
Via Parameters     0:1433
Protocol           VIA
Server             <servername>

Connecting to a named instance by server name:

Alias Name         ServerAlias
Via Parameters     0:1433
Protocol           VIA
Server             <servername>\<instancename>

Note

To specify the network protocol as a sqlcmd parameter, search Books Online for the topic How to: Connect to the Database Engine Using sqlcmd.exe.

See Also

Reference

Creating a Valid Connection String Using Shared Memory Protocol
Creating a Valid Connection String Using TCP/IP
Creating a Valid Connection String Using Named Pipes

Concepts

Choosing a Network Protocol

Help and Information

Getting SQL Server 2005 Assistance