{"id":2381,"date":"2006-10-25T20:53:00","date_gmt":"2006-10-25T20:53:00","guid":{"rendered":"https:\/\/test.simple-talk.com\/uncategorized\/more-db2-date-conversion-issues-importing-primary-keys-into-sql-server\/"},"modified":"2016-07-28T10:48:55","modified_gmt":"2016-07-28T10:48:55","slug":"more-db2-date-conversion-issues-importing-primary-keys-into-sql-server","status":"publish","type":"post","link":"https:\/\/www.red-gate.com\/simple-talk\/blogs\/more-db2-date-conversion-issues-importing-primary-keys-into-sql-server\/","title":{"rendered":"More DB2 Date Conversion Issues Importing Primary Keys into SQL Server"},"content":{"rendered":"<p>In a previous blog entry (<a href=\"https:\/\/www.simple-talk.com\/community\/blogs\/damon_armstrong\/archive\/2006\/08\/15\/1666.aspx\">Date Errors Pulling DB2 Data into SQL Server<\/a>) I recounted some of the issues I had with date conversions from DB2 to SQL Server.&#160; Another interesting issue came up.&#160; 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.&#160; My initial reaction was that the client had done something crazy and somehow managed to really mess up their data.&#160; 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.&#160; DB2 dates apparently have more precision than SQL Server.&#160; On some records, the loss of precision made some of the primary keys non-unique, causing the error.&#160; Whoops.&#160; Just another issue to look for if you&#8217;re having DB2 conversion issues.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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.&#160; Another interesting issue came up.&#160; We were pulling data from a production DB2 database and continued getting duplicate primary key violations on a few records in&#8230;&hellip;<\/p>\n","protected":false},"author":46738,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2],"tags":[],"coauthors":[],"class_list":["post-2381","post","type-post","status-publish","format-standard","hentry","category-blogs"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/2381","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/users\/46738"}],"replies":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/comments?post=2381"}],"version-history":[{"count":2,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/2381\/revisions"}],"predecessor-version":[{"id":41440,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/2381\/revisions\/41440"}],"wp:attachment":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/media?parent=2381"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/categories?post=2381"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/tags?post=2381"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/coauthors?post=2381"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}