How do I query DB2 data from SQL Server?
Q: We use DB2 Connect to access DB2 from MS Access. Do we need this for SQL Server also or does SQL Server have a built-in interface or do we need something else?
A: No you do not need to use DB2 Connect in able to access DB2 data within SQL Server. SQL Server supports linked servers which allow you to register a remote data source in SQL Server and execute queries against it. Linked servers can be remote SQL Server instances or instances of Oracle, DB2, Sybase, MySQL, etc… As long as there is a supported OLEDB driver for the data source you can add it as a linked server. There is a blog post you can read here:
http://blogs.msdn.com/dotnetinterop/archive/2006/01/20/defining-a-db2-as-a-linked-server.aspx
that walks you through the process of setting up a linked server to DB2 and you can also look up Linked Servers in books online for more information.
Tags: Programming