How does one connect SQL Server to the DB2 Server?

Source: Internet
Author: User
Tags db2 client db2 odbc driver ibm db2 ibm db2 odbc driver sql server query

This article describes the correct implementation process of connecting SQL Server databases to the DB2 connection Server. We all know that the interconnection between different database platforms is a heterogeneous database service, currently, all major databases can achieve such Heterogeneous Interconnection, but the specific implementation technologies of different vendors are different, such:

In SQL SERVER, it is called LINKED SERVER, and ODBC is used to interconnect with other databases.

The interconnection of different database platforms is generally called the heterogeneous service of databases. Currently, all major databases can achieve such Heterogeneous Interconnection, but the specific implementation technologies of different vendors are different, such: in SQL SERVER, it is called LINKED SERVER, and ODBC is used to interconnect with other databases.

The test environment in this article is:

Operating System: WINDOWS2000 SERVER (Traditional Chinese System)

Install the database: SQLSERVER2000 (English version) and DB2 7.2 client (English version)

Specific steps:

1. Install the DB2 client software and sqlserver2000 software on the PC.

2. Configure the ODBC data source for windows:

Choose "start"> "program set"> "System Management Tools"> "Data Source"> "ODBC" to configure the user DSN or system DSN: add-select IBM DB2 odbc driver-> Custom Data Source Name (for example, DB2TEST)-> Database Name (required !) -"OK.

3. Select the name of the data source you Just configured, and then select Configuration to jump out of DB2 MESSAGES:

The data source is not connected. Connecting to the data source will provide useful information during configuration. wocould you like to connect to the data source?

Select YES (OK or OK ).

Go TO the connect to DB2 DATABASE screen:

User id: USER who entered the DB2 DATABASE

PASSWORD: enter the PASSWORD of the DB2 DATABASE user.

Connection mode: You can select the default share mode.

Select OK!

ODBC configuration and test completed!

4. Configure the connection server in sqlserver2000:

Enterprise Manager-security-connection server-right-click Create DB2 connection server-define the connection name; select another data source; specify the program name as ibm ole db Provider for DB2 SERVERS; the product name is optional. The data source specifies the data source name defined in ODBC just now. The provider string is in the following format:

User ID = username; Password = userpasswd (or in the following format: UID = username; PWD = userpasswd ), here, the user name and password correspond to the user name and password in the DB2 database to be connected-> Security Tab: set to use this security context, enter the database username and password of DB2. On the "server options" tab, click "OK" by default.

5. All preparations have been completed! In sqlserver Enterprise Manager-security-DB2 connection server open the newly established connection server-click the table, you can see all the table names owned by the DB2 database user in the right window, however, the table records cannot be viewed here. You need to use specific SQL statements in the SQL Server Query analyzer! When accessing a table, the format is [connection server name]... [DB2 user]. [Table name]. For more details, I will not go into details here.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.