Feedback
Did this article resolve your question/issue?

   

Article

ODBC connection to a SQL Server named instance

Information

 
TitleODBC connection to a SQL Server named instance
URL Name000046076
Article Number000114209
EnvironmentProduct: Connect(64) for ODBC SQL Server driver, Connect(64) for ODBC SQL Server Legacy Wire Protocol driver
Version: All supported versions
OS: All supported platforms
Database: SQL Server
Application: All ODBC applications
Question/Problem Description
Can DataDirect Connect for ODBC SQL Server Wire Protocol driver connect to SQL Server named instance?
How to make an ODBC connection to a SQL Server named instance?
Steps to Reproduce
Clarifying Information
Error Message
Defect Number
Enhancement Number
Cause
Resolution
The syntax for specifying a Named Instance is server_name\instance_name.

For the SQL Server Wire Protocol driver, this is set in the Host Name (HostName) attribute on both Windows and Unix/Linux as below.
HostName=server_name\instance_name
The PortNumber value can either be blank which will make the driver use the default value 1433 or explicitly set to 1433 as below
PortNumber=1433


For the SQL Server Legacy Wire Protocol driver, the connection attribute is different depending on the platform:
On Windows, use the Server attribute:
Server=server_name\instance_name

On Unix/Linux, use the Address attribute:
Address=server_name\instance_name

NOTE: The SQL Server Browser Service (port 1434) should be up and running for the connection to succeed when specifying the instance name.


The connection may also be specified using a HostName and PortNumber value without specifying the actual SQL Server instance name in the connection parameters as below.
  1. Identify the actual TCP port for the SQL Server instance using SQL Server Configuration Manager
    • Click Start -> Programs -> Microsoft SQL Server xxx -> Configuration Tools -> SQL Server Configuration Manager
    • In SQL Server Configuration Manager, expand SQL Server Network Configuration and then select Protocols for on the left panel. To identify the TCP/IP Port used by the SQL Server Instance, right click on TCP/IP and select Properties from the drop down.
    • In TCP/IP Properties window, click on the IP Addresses tab and scroll to the bottom and to see the Port used by the instance of SQL Server in either TCP Dynamic Ports for a dymanic port or TCP Port for a static port for example, 12345.
  2. Connect to the database specifying the server name and the instance port number as below

    For the SQL Server Wire Protocol driver, on both Windows and Unix/Linux:
    HostName=server_name
    PortNumber=12345

    For the SQL Server Legacy Wire Protocol driver,
    On Windows, use the Server attribute:
    Server=server_name,12345

    On Unix/Linux, use the Address attribute:
    Address=server_name,12345
Workaround
Notes
References to other documentation:
Progress DataDirect Connect Series for ODBC User's Guide, "Drivers for 32-Bit and 64-Bit Platforms" : "The SQL Server Wire Protocol Driver" : "Connection Option Descriptions for SQL Server Wire Protocol" : "Host Name"
http://media.datadirect.com/download/docs/odbc/allodbc/#page/odbc%2FHost_Name_5.html%23

Progress DataDirect Connect Series for ODBC User's Guide, "Drivers for 32-Bit and 64-Bit Platforms" : "The SQL Server Wire Protocol Driver" : "Connection Option Descriptions for SQL Server Wire Protocol" : "Port Number"
http://media.datadirect.com/download/docs/odbc/allodbc/#page/odbc%2FPort_Number_6.html%23

Progress DataDirect Connect Series for ODBC User's Guide, "Drivers for 32-Bit and 64-Bit Platforms" : "The SQL Server Legacy Wire Protocol Driver" : "Connection Option Descriptions" : "Server"
http://media.datadirect.com/download/docs/odbc/allodbc/#page/odbc%2Fserver.html%23wwID0E162W

How to connect to SQL Server by using an earlier version of SQL Server (shows how to find the port number for a named instance)
http://support.microsoft.com/kb/265808

 
Last Modified Date8/3/2018 8:45 PM
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.