Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Generate extract with varrying column size Expand / Collapse
Author
Message
Posted Monday, December 8, 2008 11:37 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, April 27, 2009 8:17 AM
Points: 18, Visits: 56
Hi Frenz,

I got a requirement from customer that I have to pick up some data from a table to generate a csv extract and ftp to server of another system. The required format is as follows -

10, Mig_id
30, remote_nni_1,procnni, tun. conc, lcn, status, baerer, DN
30, remote_nni_1,procnni, tun. conc, lcn, status, baerer, DN
30, remote_nni_1,procnni, tun. conc, lcn, status, baerer, DN
30, remote_nni_2,procnni, tun. conc, lcn, status, baerer, DN
30, remote_nni_2,procnni, tun. conc, lcn, status, baerer, DN
30, remote_nni_2,procnni, tun. conc, lcn, status, baerer, DN
90, Trailer record

In the above format actual data are records starting with 30. Those records are being picked up from one table. I need to append 10 & 90 records at the top & bottom accordingly for error handling at the destination system.

How can I do that? I could put them in one temp table and finally pickup from there. However that will generate unnecessary "," after Mig_id & Trailer.

Can I do something with Transformation task? plzz help
Post #615942
Posted Wednesday, December 10, 2008 3:13 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, October 1, 2013 10:45 AM
Points: 64, Visits: 105
I think BCP would be more useful in this situation. You can just write those two lines in BCP query to get appended in file. Moreover performance will also be good.
Post #616811
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse