Go Premium for a chance to win a PS4. Enter to Win

x
?
SolvedPrivate

SQL Server 2008 - SSIS transform

Posted on 2014-10-29
3
Medium Priority
?
26 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
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

877 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