Other Heterogeneous Subscribers

SQL Replication

Replication

Other Heterogeneous Subscribers

This section includes the data type mappings for Subscribers running DB2/NT or DB2/6000 as well as the driver types needed for ODBC Subscribers.

IBM DB2/NT

IBM DB2/NT subscriptions to Microsoft® SQL Server™ 2000 publications are supported through the OLE DB provider and ODBC driver that are included with Microsoft Host Integration Server 2000. 

The following table maps SQL Server 2000 data types to IBM DB2/NT data types. When you replicate to OLE DB or ODBC Subscribers, the distribution task maps SQL Server 2000 data types to the closest data type on the target database.

SQL Server 2000 data type IBM DB2/NT data type
binary(n) CHAR(254) FOR BIT DATA NOT NULL
bit SMALLINT
char(n) CHAR (254) NOT NULL
datetime TIMESTAMP
decimal DECIMAL
double precision DOUBLE
float FLOAT
image VARCHAR(4000) FOR BIT DATA
int INTEGER NOT NULL
money DECIMAL(19, 4)
numeric NUMERIC
real REAL
smalldatetime TIMESTAMP NOT NULL
smallmoney DECIMAL(10, 4)
text VARCHAR (4000)
timestamp CHAR(8) FOR BIT DATA)
tinyint SMALLINT NOT NULL
uniqueidentifier CHAR (38)
varbinary(n) VARCHAR(4000) FOR BIT DATA NOT NULL
varchar(n) VARCHAR (4000) NOT NULL
IBM DB2/6000

IBM DB2/6000 subscriptions to MSQL Server 2000 publications are supported through the OLE DB provider and ODBC driver that are included with Microsoft Host Integration Server 2000. 

The following table maps SQL Server 2000 data types to IBM DB2/6000 data types. When you replicate to OLE DB or ODBC Subscribers, the distribution task maps SQL Server 2000 data types to the closest data type on the target database.

SQL Server 2000 data type IBM DB2/6000 data type
binary(n) CHAR(254) FOR BIT DATA NOT NULL
Bit SMALLINT
char(n) CHAR (254) NOT NULL
Datetime TIMESTAMP
Decimal NUMERIC (28, 14) NOT NULL
Float INTEGER NOT NULL
Image VARCHAR(4000) FOR BIT DATA
Int INTEGER(10) NOT NULL
Money DECIMAL(19, 4)
Numeric NUMERIC
Real REAL
Smalldatetime TIMESTAMP NOT NULL
Smallint SMALLINT
Smallmoney DECIMAL (10, 4) NOT NULL,
Text VARCHAR (4000)
Timestamp CHAR(8) FOR BIT DATA
Tinyint SMALLINT NOT NULL
Uniqueidentifier CHAR (38)
varbinary(n) VARCHAR(4000) FOR BIT DATA NOT NULL
varchar(n) VARCHAR (4000) NOT NULL

ODBC Driver and OLE DB Provider Support

ODBC drivers and OLE DB providers for various heterogeneous data sources are included on the SQL Server 2000 compact disc.

Drivers for other ODBC Subscriber types must conform to the SQL Server 2000 replication requirements for generic ODBC Subscribers. The ODBC driver:

  • Must be ODBC level-1 compliant.

  • Must be 32-bit, thread-safe, and for the processor architecture (Intel or Alpha) on which the distribution process run.

  • Must be transaction capable.

  • Must support the Data Definition Language (DDL).

  • Cannot be read-only.

  • Must support long table names such as MSreplication_subscriptions.
Replicating Using OLE DB Interfaces

SQL Server 2000 replication can use OLE DB interfaces to execute SQL statements at Subscribers using the ICommand interface. OLE DB providers must support these objects for transactional replication:

  • DataSource object

  • Session object

  • Command object

  • Rowset object

  • Error object
DataSource Object Interfaces

The following interfaces are required to connect to a data source:

  • IDBInitialize

  • IDBCreateSession

  • IDBProperties

If the provider supports the IDBInfo interface, SQL Server 2000 uses the interface to retrieve information such as the quoted identifier character, maximum SQL statement length, and maximum number of characters in table and column names.

Session Object Interfaces

The following interfaces are required:

  • IDBCreateCommand

  • ITransaction

  • ITransactionLocal

  • IDBSchemaRowset
Command Object Interfaces

The following interfaces are required:

  • ICommand

  • ICommandProperties

  • ICommandText

  • ICommandPrepare

  • IColumnsInfo

  • IAccessor

  • ICommandWithParameters

IAccessor is necessary to create parameter accessors. If the provider supports IColumnRowset, SQL Server 2000 uses that interface to determine whether a column is an identity column.

Rowset Object Interfaces

The following interfaces are required:

  • IRowset

  • IAccessor

  • IColumnsInfo

An application should open a rowset on a replicated table that is created in the subscribing database. IColumnsInfo and IAccessor are needed to access data in the rowset.

Error Object Interfaces

Use the following interfaces to manage errors:

  • IErrorRecords

  • IErrorInfo

Use ISQLErrorInfo if it is supported by the OLE DB provider.

For more information about the OLE DB provider, see the documentation supplied with your OLE DB provider.

Note  The primary source of information regarding the use of OLE DB is the OLE DB Programmer's Reference Version 2.0 available with the OLE DB Software Development Kit (SDK).