Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 SSIS and Import/Export (2012)
 Urgent SSIS Help

Author  Topic 

tooba
Posting Yak Master

224 Posts

Posted - 2013-10-29 : 22:22:23
Hi Guys,

Need help, Here is my sample data


LAT|BOX|5290113661|BP9744524|PHY|JAI|GREWAL|1|BI|VaccBill|MED|191.2||SHI||20131015|50242
06001|||||6|116820411||
LAT|BARDI|TAMMY|20020 44th|PHY|MARK|MORADI|BI|Vacc Bill|MED|183.0||SHI||20131016|50242006001|||||6|116899590||
LAT|ARRE|SONIA|344 RICH|PHY|IAN|HANT|1|BI|Vacc Bill|MED|153||SHI||20131016|50242006|||||3|116786607|

AND I want to be my out put in Flat file like this.

LAT|BOX|5290113661|BP9744524|
PHY|JAI|GREWAL|1|
BI|Vacc Bill|
MED|191.2||
SHI||20131015|50242006001|||||6|116820411||

LAT|BARDI|TAMMY|20020 44th|
PHY|MARK|MORADI|
BI|Vacc Bill|
MED|183.0||
SHI||20131016|50242006001|||||6|116899590||

LAT|ARRE|SONIA|344 RICH|
PHY|IAN|HANT|1|
BI|Vacc Bill|
MED|153||
SHI||20131016|50242006|||||3|116786607|


Here I want, Split in second rows Where start with "PHY",
Third Row where find "BI",
Fourth Row where find "MED",
fifth row where find "SHI"...

Please let me know if you need more information....

First Step I am using to create a Store Procedure with all information and calculated what I need and my SP Out is above sample data.

Second step I am using to do some steps and transfer data from SQL table to flat file, here my flat file would be like that (out sample is above). I know I can use Script Task to accomplish what I want or other way to accomplish this task.

Any advise would be great...

Thank You...

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-10-30 : 01:09:34
i would use bcp for this with a custom format specified by means of format file
you can call it inside SSIS also
see

http://visakhm.blogspot.in/2013/10/bcp-out-custom-format-data-to-flat-file.html

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -