More DB2 Date Conversion Issues Importing Primary Keys into SQL Server

In a previous blog entry (Date Errors Pulling DB2 Data into SQL Server) I recounted some of the issues I had with date conversions from DB2 to SQL Server.  Another interesting issue came up.  We were pulling data from a production DB2 database and continued getting duplicate primary key violations on a few records in some of the tables.  My initial reaction was that the client had done something crazy and somehow managed to really mess up their data.  But after taking a look at the tables in which the error was occurring, we found out that all of those tables had Date columns as part of the primary key.  DB2 dates apparently have more precision than SQL Server.  On some records, the loss of precision made some of the primary keys non-unique, causing the error.  Whoops.  Just another issue to look for if you’re having DB2 conversion issues.