SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Generate extract with varrying column size


Generate extract with varrying column size

Author
Message
Rajarshi Mukherjee
Rajarshi Mukherjee
Grasshopper
Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)

Group: General Forum Members
Points: 24 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
nikhil8960
nikhil8960
SSC-Enthusiastic
SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)

Group: General Forum Members
Points: 114 Visits: 108
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.Rolleyes
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search