Advertisement

03.03.2008 at 08:40AM PST, ID: 23209844
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Using SSIS Import Wizard - will not map db2 date to sql
Tags: Microsoft, SQL, 2005, SSIS import wizard - problem converting dates, The data type could not be assigned to the column "XXXXXXXX" in "Microsoft OLE DB Provider for SQL Server"., mapping db2 v9 to SQL
Im using the SQL Server Import and Export Wizard that comes with SSIS.  The data source is ibm's 'IBM OLE DB Provider for DB2'.  I believe the MappingFiles that it should be using is 'IBMDB2ToMSSql.XML (see attached 'text' file; the SourceType="IBMDADB2".

When the wizard maps db2 file, for date fields I receive the following message.
"The data type could not be assigned to the column "xxxxxx" in "Microsoft OLE DB Provider for SQL Server".

Within the wizard, it say's it can't figure out how to map the db2 date fields.  If I go ahead and force it to map to datetime, it works.  However, I have over 200 tables and I would just as soon let the computer do the work for me. ;^)

Attachments:
 
The xmil file found in the C:\Program Files\Microsoft SQL Server\90\DTS\MappingFiles directory
 
Start your free trial to view this solution
Question Stats
Zone: Microsoft
Question Asked By: peeksnib
Solution Provided By: peeksnib
Participating Experts: 3
Solution Grade: A
Views: 123
Translate:
Loading Advertisement...
03.03.2008 at 05:31PM PST, ID: 21037530

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.03.2008 at 10:56PM PST, ID: 21038831

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.04.2008 at 04:51AM PST, ID: 21040367

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.04.2008 at 06:06AM PST, ID: 21040971

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.04.2008 at 06:12AM PST, ID: 21041042

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.04.2008 at 06:44AM PST, ID: 21041379

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.04.2008 at 06:49AM PST, ID: 21041431

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.04.2008 at 07:47AM PST, ID: 21042017

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.04.2008 at 11:55AM PST, ID: 21044421

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.04.2008 at 12:08PM PST, ID: 21044554

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.04.2008 at 12:23PM PST, ID: 21044696

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.04.2008 at 12:32PM PST, ID: 21044786

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.04.2008 at 01:45PM PST, ID: 21045437

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.04.2008 at 02:38PM PST, ID: 21045918

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.11.2008 at 12:57PM PDT, ID: 21099472

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
03.03.2008 at 05:31PM PST, ID: 21037530

Rank: Wizard

Consider the option of importing the data from DB2 into staging tables as character data and then converting the datatime values.
 
03.03.2008 at 10:56PM PST, ID: 21038831

Rank: Wizard

what is the db2 data type ?
have you tried to change that xml file to import db2 dates as characters ? though it probably won't allow for the conversion you need

i think that in this case, you should do some additional work
what is the target data type you want to have in sql server ?

if changing the xml does not do the work, i will recommend creating a view on each db2 table and have that view convert the date column to the required format that sql server expects, and then have the SSIS work on those view
the view generation can be done dynamically using a query
you don't have to write a create view statement for each table manually
 
03.04.2008 at 04:51AM PST, ID: 21040367
momi sabag:
According to the ssis server expolorer the input field is defined as DATE.  The target ms sql data field should be datetime.  Below is an example of three 'date' field being diplayed in the ssis server explorer.
1/1/0001 12:00:00 AM      2/29/2008 12:00:00 AM      NULL
11/2/1979 12:00:00 AM      2/29/2008 12:00:00 AM      NULL
7/15/1980 12:00:00 AM      2/29/2008 12:00:00 AM      NULL
7/30/1980 12:00:00 AM      2/29/2008 12:00:00 AM      NULL
12/15/1980 12:00:00 AM      2/29/2008 12:00:00 AM      NULL
3/23/1981 12:00:00 AM      2/29/2008 12:00:00 AM      NULL
7/1/1981 12:00:00 AM      2/29/2008 12:00:00 AM      NULL

I have not tried import the db2 dates as characters (thought it should just work)  Have you any suggestions on what I should put in the 'mapping' xml?

As to creating a view of the table, the DB2 souce is a 'hard to get anything out of them' data warehouse.  We don't have write access to their system.

acperkins:
I would consider the option if I can't get the import wizard to work.  (less steps means less mess - especially for the end user that will be creating/running the import wizard ;^)
 
03.04.2008 at 06:06AM PST, ID: 21040971

Rank: Wizard

>>less steps means less mess<<
Actually, I do not agree with you here.  You should never import directly to your production tables and always use staging tables.  This allows you to validate and transforming the data before committing it.  Rememer the old axiom: Junk in, junk out.
 
03.04.2008 at 06:12AM PST, ID: 21041042
acperkins:
You got me there.  My client wants to see the junk.  She doesn't know what she's looking for until she sees it.  Her idea of data mining.
 
03.04.2008 at 06:44AM PST, ID: 21041379

Rank: Wizard

And that is exactly what the staging tables are for.  So that she can approve them before they get imported in.
 
03.04.2008 at 06:49AM PST, ID: 21041431

Rank: Wizard

Hi peeksnib,

I'm not familiar with SSIS so I'll defer all matters pertaining to it to the other experts.

But I will caution you on converting date fields from DB2 to SQL Server.  I've worked with a number of systems where this was a requirement and it has always been problematic.  The underlying issue is that DB2 uses an epoch data of January 1, 0001 (stored internally as 00010101) so that any date from January 1, 0001AD is valid.  SQL Server seems to apply a bias to the year so that the actual storage of the data requires a smaller data field than is used in DB2.  (The bias may be configurable.)  

I'm aware of several instances where the bias is 1970.  This has the potentially catastrophic affect of rendering all dates prior to January 1, 1970 as illegal dates since SQL Server can not record dates prior to its own epoch date.  This further complicates conversion efforts by requiring special handling on the DB2 side of dates that SQL Server deems to be illegal.  The DB2 side will have to convert these dates to valid dates or NULL (depending on the SQL Server side definitions).

Good Luck,
Kent


 
03.04.2008 at 07:47AM PST, ID: 21042017
KDO:
We will have dates before 1970; Thanks for making it aware to me, I'll need to test it in the final solution.
 
03.04.2008 at 11:55AM PST, ID: 21044421

Rank: Wizard

In MS SQL Server the range for a datetime data type is  January 1, 1753 to December 31, 9999 (smalldatetime is January 1, 1900 to June 6, 2079)

If you are wondering what is the significance of the year 1753, that is the year that calendars world wide were standardized to follow the Gregorian calendar.  Prior to that all dates are suspect.
 
03.04.2008 at 12:08PM PST, ID: 21044554

Rank: Wizard

Hi ac,

My memory's a biz fuzzy.  Do you know if 1/1/1753 is a hard coded epoch date or if it's configurable?  And to which versions of SQL Server this is applicable?

I truly seem to recall a SQL Server 2000 database that was using 1970 as the epoch date.

Kent

 
03.04.2008 at 12:23PM PST, ID: 21044696

Rank: Wizard

>>Do you know if 1/1/1753 is a hard coded epoch date or if it's configurable?  And to which versions of SQL Server this is applicable?<< It has always been that way.  Well, at least since v6.x (and I have no reason to believe that 4.2 was any different)

>>I truly seem to recall a SQL Server 2000 database that was using 1970 as the epoch date.<<
UNIX use a January 1, 1970 base date.  Perhaps you are thinking of that.
 
03.04.2008 at 12:32PM PST, ID: 21044786

Rank: Wizard


Hmmm....

I guess that I need to do some more research as I distinctly recall a DTS package aborting because the DB2 date that is was importing was in the 1950s.


Kent
 
03.04.2008 at 01:45PM PST, ID: 21045437
KDO:
So... Were you able to get the import/export wizard to work on a date field at all from db2 to sql, or just when it had a 1950s date?
 
03.04.2008 at 02:38PM PST, ID: 21045918

Rank: Wizard


Hi peeksnib,

As I said, I'm not familiar with SSIS.  But I have used DTS, MS Access, and other tools to convert DB2 data, including dates.


Kent
 
03.11.2008 at 12:57PM PDT, ID: 21099472
Whenever I use the Import/Export wizard from DB2 to SQL, I have to manually map and set all of the db2 'date' fields to sql 'datetime' fields.  I could not get the wizard to automatically convert date to datetime.
Accepted Solution
 
 
20080236-EE-VQP-29 / EE_QW_2_20070628