What we want to tell you today is that it is very easy to correctly implement the SQL Server database to connect to the DB2 Server. The following describes the actual operations to connect the SQL Server database to the DB2 Server, I hope this will help you in your future studies.
This article mainly describes the correct implementation process of connecting SQL Server to DB2 Server and the actual operating environment used in actual operations, the following describes the actual steps for connecting SQL Server to the DB2 Server.
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 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.
Would 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-DB2 connection server-right-click Create 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 = usernameassword = usERPasswd (or in the following format: UID = usernameWD = userpasswd). the User name and password here correspond to the User name and password in the DB2 database to be connected-Security Tab: set the security context and enter the database user name and password of DB2. The "server option" tab is displayed 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.
The above content is very easy to implement SQL Server to connect to the DB2 Server! In this regard.