SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 Query help
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

aswindba1
Yak Posting Veteran

USA
62 Posts

Posted - 04/03/2013 :  15:12:30  Show Profile  Reply with Quote

I need to pull the info from excel to the Database table through SSIS. I need logic for below scenario.

Excel Look like below:

Server Name Cost Type Values
SAB245 DRU 200
SAB246 DRU 2001
SAB247 TAPE 300
SAB248 TAPE 3001
SAB249 DISK 100
SAB250 DISK 1001


Output table should be:

Server Name DRU Cost TAPE Cost Disk Cost
SAB245 200 Null Null
SAB246 2001 Null Null
SAB247 Null 300 Null
SAB248 Null 3001 Null
SAB249 Null Null 100
SAB250 Null Null 1001

Please let me know if you need more explanation.

thanks

aswindba1
Yak Posting Veteran

USA
62 Posts

Posted - 04/03/2013 :  16:30:50  Show Profile  Reply with Quote

I need to pull the info from excel to the Database table through SSIS. I need logic for below scenario.

Excel Look like below:

Server Cost Values
SAB245 DRU 200
SAB246 DRU 2001
SAB247 TAPE 300
SAB248 TAPE 3001
SAB249 DISK 100
SAB250 DISK 1001


Output table should be:

Server DRU TAPE Disk
SAB245 200 Null Null
SAB246 2001 Null Null
SAB247 Null 300 Null
SAB248 Null 3001 Null
SAB249 Null Null 100
SAB250 Null Null 1001

Please let me know if you need more explanation.

thanks

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52249 Posts

Posted - 04/04/2013 :  01:28:26  Show Profile  Reply with Quote
it looks like a straight forward task.
You just need a data flow task with excel source and OLEDB destination to connect to table
In between you need a derived column to create three new columns DRU,TAPE and Disk

the expression will be like

([Cost]=="DRU"? [Values] : NULL(DT_I4)) for DRU
([Cost]=="TAPE"? [Values] : NULL(DT_I4)) for TAPE
([Cost]=="Disk"? [Values] : NULL(DT_I4)) for Disk

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000