1

( This is an edit...the real post was really big )

I'm having problem with my SQL Server 2008 to DB2 linked server.

I'm getting this error:

TITLE: Microsoft SQL Server Management Studio

The linked server has been created but failed a connection test. Do you want to keep the linked server?

ADDITIONAL INFORMATION: An exception occurred while executing a Transact-SQL statement or batch.
(Microsoft.SqlServer.ConnectionInfo)

Cannot initialize the data source object of OLE DB provider "DB2OLEDB" for linked server "DB2LINKEDSERVER". OLE DB provider "DB2OLEDB" for linked server "DB2LINKEDSERVER" returned message "". (Microsoft SQL Server, Error: 7303)

When click "connect" on DSN:

error dsn

Error in SQL Server Management Studio:

enter image description here

  • Which OS is your DB2 on? Unix, Linux, or Windows? Because ODBC is generally bound by default (given which packages get bound by the admin when creating databases) on Unix and Linux, but must be explicitly bound by the admin on Windows. That might be part of your issue here. – Chris Aldrich Jun 15 '15 at 12:15
  • Yes I have no idea what OS it is. I'm trying to contact the DB2 DBA but with no success since last week. i'm trying to create a DSN with this C:\WINDOWS\SysWOW64\odbcad32.exe but there are a lot of " questions" that I don't have. this is harder than create a MySQL linked server. – Racer SQL Jun 15 '15 at 12:30
  • If SQL Server is a 64bit application you also need to define a 64bit ODBC datasource which means you need a 64bit ODBC driver for DB2. You also need to use the correct ODBC admin tool. According to: msdn.microsoft.com/en-us/library/cc645931.aspx you need to use %SystemRoot%\system32\odbcad32.exe – a_horse_with_no_name Jun 15 '15 at 12:34
  • Horse, With this .exe theres only 2 options ( SQL Server , SQL Server native client ). It was my first option. I downloaded some files from IBM but It's not working. Still can't select IBM DB2 ODBC DRIVER. – Racer SQL Jun 15 '15 at 13:09
  • If the DSN works via ODBC, have you tried using the OLE DB Provider for ODBC Drivers for the linked server? – Queue Mann Jun 15 '15 at 14:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.