SolvedPrivate

SQL Server 2008 - SSIS transform

Posted on 2014-10-29
3
23 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 65

Accepted Solution

by:
Jim Horn earned 500 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 65

Expert Comment

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

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
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
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

752 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