Original http://database.51cto.com/art/201108/283240.htm
SQL ServerAvailableLinked serverFunction to connect to other databases to perform operations between different databases. This topic describes how to use SQL Server to connect to a server.DB2The operation steps of the database are given in detail. Let's take a look at this part.
Use the link server of SQL Server to connect to DB2
1. Download and install Microsoft oledb provider for DB2. The default access interface on the SQL server connection server does not have DB2.
2. OpenProgramMenu-Microsoft oledb provider for DB2-data access tool.
3. Use the data access tool to create a data source.
On the platform, I chose DB2/as400 (the server is an HP minicomputer). The shared name of the next certificate is omitted.
I wrote the database name for the initial directory and package set. The default Delimiter is blank.
4. Obtain the connection string
5. create an SQL server linked server, link the server (named by yourself), select Microsoft OLE DB provider for DB2 as the access interface, and set the product name (available database name) to the server name as the data source, the access interface string is the connection string generated in the preceding tool.
6. After the connection test is successful, you can query it, for example:
- Select *
- From [db2svr]. [DB2]. [administrator]. [ABC]
The above is the whole process of using the SQL Server link server to connect to DB2 for operations. This article introduces so much and hopes this introduction will help you.