Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
SolvedPrivate

SQL Server 2008 - SSIS transform

Posted on 2014-10-29
3
Medium Priority
?
25 Views
Last Modified: 2016-02-11
I am creating a sql ssis package.  

The basics of the package is it takes data from a view in Oracle...and puts it in a table in SQL Server.

To get the package started I just used the wizard and made an ssis package that way...then copied that into a more advanced template I have.

However...this is my issue.   Lets say I have a column called account number.   In Oracle it comes over as a varchar(11)...when in fact in sql server I am going to want that to be a varchar(7).  There must be some type of inherent padding in Oracle....

Should I handle this trimming of the fields in the process of it moving from Oracle to sql...

or should I take the table once its in sQL server..and transform it a second time to sql server?

Any suggestions?


Thanks
0
Comment
Question by:Robb Hill
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 66

Accepted Solution

by:
Jim Horn earned 2000 total points
ID: 40410574
>There must be some type of inherent padding in Oracle....
Explain this.  Left padded spaces, right padded spaces, both?

>Should I handle this trimming of the fields in the process of it moving from Oracle to sql...
Answer could go both ways, so I'd write it in whatever you feel more comfortable with.
   If you can create a view in Oracle that does this and serve as the source, fine.
   SSIS derived column task is fine too.
   Although....

>>or should I take the table once its in sQL server..and transform it a second time to sql server?
I have a preference for doing it this way.  Inserting ALL rows into SQL Server varchar columns, which insures that no matter what blows up, insures that at least the data made it to the target SQL database.  Doing this way implies writing to a staging or temporary table, which I usually prefix with ssis_ or timp_.  

Then you can write a T-SQL SP to do your data scrubbing:  Whatever logic handles the varchar(11) to varchar(7) 'padding', dates are dates, numbers are numbers, you get the idea.  Then import the good rows to the final destination table, and gracefully handle any bad rows.
0
 
LVL 11

Author Closing Comment

by:Robb Hill
ID: 40410582
I have no control over the view being exposed in Oracle....and dont really know how to do this in the middle between the source and destination OLD DB connections.

I will just scrub my staging table and make a new table with all the trimmings..


Thanks for your input!
0
 
LVL 66

Expert Comment

by:Jim Horn
ID: 40410595
Thanks for the grade.  Good luck with your project.  -Jim
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question