DB2 Code Page Fun

A while back I had a customer who was importing data from AS/400 DB2 tables into SQL Server, using SSIS, and we came upon an interesting error. The below describes how to actually reproduce the issue, and the fix. The fix is currently in all versions of our DB2 Data Provider at this point (assuming you have the latest…

1

Using PowerShell to Access DB2

Yes, PowerShell can be used to access DB2 using The Microsoft Host Integration Server Data Providers.   Not a tutorial, but here is the script, ran using HIS 2004’s data provider: $cn = new-object system.data.OleDb.OleDbConnection(“Provider=DB2OLEDB;User ID=<userid>;Password=<password>;Initial Catalog=<catalog>;Network Transport Library=TCP;Host CCSID=37;PC Code Page=1252;Network Address=DB2V82;Network Port=50000;Package Collection=<collection>;Default Schema=<schema>;Process Binary as Character=False;Units of Work=RUW;DBMS Platform=DB2/NT;Defer Prepare=False;Persist Security Info=True;Connection…

1

Importing CHAR() fields containing null values from DB2 to SQL Server via SSIS

Earlier this year, I was working with a customer who was doing a mainframe migration from DB2 to SQL Server, and they were using SSIS to import the tables. Several of their columns were CHAR data types, with a null byte as the first byte of the field. The columns, when imported, all contained empty…

1