Query via linked server to DB2 gives different results
I have a DB2 9.7 database I need to query. I set up a linked server from a SQL 2012 SP2 box, run QueryA, and am happy with the results. I create a linked server from the production machine, using the same script. I run QueryA and get the message, "Error converting data type DBTYPE_DBDATE to datetime." If I convert the datetime to a varchar, call it QueryB, it mostly works, but will be missing a small percentage of datetime values from that converted column. If I run QueryB on the first server, those missing values are there. I loaded MS OLE DB Provider for DB2 Version 4.0 in both places. I used the same script and connection string in both places. I used the same query, which uses OPENQUERY, in both places. I did the same test on a third server. This server is SQL 2012 SP1 CU1. It works fine. The only difference I can see is the service pack and CU level. I can't find any documentation on updates that are relevant, but doesn't mean much. ---------- I just did the same test on fourth server, with SQL2012 SP1, same as the second machine, which is the only server to have the problem, and the one where I need it to work. This fourth one did not fail. Apparently it's not the service pack or cumulative update level making the difference.