SolvedPrivate

SQL Server 2008 - SSIS transform

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

My client sends data in an Excel file to me to load them into Staging database. The file contains many sheets that they have same structure. In this article, I would like to share the simple way to load data of multiple sheets by using SSIS.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now