Creating Linked server to SYBASE from SQL Server
In this article we going to look into creating a heterogeneous linked server. i.e. We are going to create a linked server to SYBASE database server from SQL Server environment and then going to query datas from Sybase. First step in heterogeneous linked server is to create a ODBC connection to that RDBMS platform. For creating ODBC connection we need the ODBC drivers for that RDBMS platform. In this case we need Sybase driver in client machine, this is not included in windows so you need to download it from Sybase Website. Lets discuss on this step by step
Testing Environment
Windows 7
SQL Server 2008
Sybase ASE Developer Edition 15.02
Sybase ODBC Driver 3.51
Sybase DBName : sqlarticles (authors table with 4 test records)
Implementation Steps
- Download Sybase ODBC drivers from the link Get Sybase ODBC Driver . Please note from Sybase ASE 15, Sybase will not ship the 3rd party DataDirect ODBC driver, Sybase has developed their own ODBC driver and it will be shipped.
- Install the Sybase driver from the downloaded setup.
- Once installation completed go to Run> Type odbcad32 and press enter
- In the ODBC admin window go to System tab as shown below

- When you click on Add button a list of ODBC drivers available in the system will be shown, select Adaptive Server Enterprise (this will not be displayed if you havent installed Sybase ODBC Drivers) and then click finish button

- Now you will be shown with the ODBC driver configuration, all the fields in the window are self explanatory hence fill all the details required (you can also go to other tabs for other ODBC options) and click on Test Connection button to test the ODBC connection. Now another window will pop up to enter the password, just enter the credential and click OK as shown below


- Now you have created the ODBC connection successfully, the next step is to create a new linked server in SQL Server.
- Open Management studio and connect to the SQL Server Instance
- Expand Server Objects in object explorer and right click on Linked Servers folder and then click on New Linked server in the menu as shown below

- New Linked server window will popup, fill all the details required. Provide the name for the Linked server, Select Other Data Source Option button, Select Provider as Microsoft OLE DB Provider for ODBC Drivers and provide the ODBC name in the field Data Source.

- Since we dont have the facility to enter the credential details in ODBC, we need to update the details here. To accomplish this, click on the Security tab in the left hand pane and provide Sybase credentials as shown below

- Thats it we have created a linked server to Sybase server from SQL.
Querying Data from Sybase Linked Server
Connect to SSMS and open a new query window and type the query to retrieve datas from Sybase linked server.
select name from sybase.sqlarticles.dbo.authors

Tags: administration, linked server, management, sybase
Trackback from your site.
Comments (4)
mike
| #
Thank you so much!!! Working great!!!!
Reply
Can’t migrate from Sybase ASA to SQL Server using SSMA - SQL Server Migration Assistant (SSMA) Team's Blog - Site Home - MSDN Blogs
| #
[...] : http://sql-articles.com/articles/dba/creating-linked-server-to-sybase-from-sql-server/ (These are for ASE but are the same for ASA except that you have to choose a different [...]
Reply
Andres Gutierrez
| #
Hello, I am trying to make this procedure but when I test the connection, right after I give the information on the Login window, appears the following error:
[Sybase][ODBC Driver][Adaptive Server Enterprise]SQL Anywhere Error -157: Cannot convert ’08/10/09′ to a timestamp
Do you have any idea or suggestion to fix this problem? I dont know where that date comes from. Regards. Andres.
Reply
VidhyaSagar
| #
@Andres – Sybase date format is not matched with SQL Server date format. If you are using ODBC driver then update in ODBC entry for AFTER connecting.
set temporary option date_order=’MDY’
If this isnt working then check SQL Server default date format and then change accordingly
Reply