how to add specific header and footer to flat file using SSIS 2008


the ssis package need create file  headers, totals , adds status position 1 of records.

header: "$$add id=entk0557 bid='ia   hbzac14hbzachrycorp' password='customer        ' %au hbzac14" added.

$$add = static
id=entk0557 = static
bid='ia   hbzac14hbzachrycorp' = "hbzac14" company, "hbzachrycorp" company name
password='customer        '  = static
hbzac14 = company

control totals:
t010533343 000050 0002659604 000000 0000000000

t = totals
010533343 = account number
000050 = total records
0002659604 = total checks
000000 = tbd
0000000000 = tbd

data file

-------------------------------

declare

@t as table

(

[br-issue-void-ind] [char]

(1) null,

[br-acct-nbr] [varchar]

(9) null,

[filler1] [char]

(1) null,

[br-serial-nbr] [varchar]

(8000) null,

[br-check-amt] [varchar]

(8000) null,

[br-ck-issue-date] [varchar]

(6) null

)

insert

into @t

(

[br-issue-void-ind]

,

[br-acct-nbr]

,

[filler1]

,

[br-serial-nbr]

,

[br-check-amt]

,

[br-ck-issue-date]

)

select

'c' ,null,' ',30090072,2114.39,100502

union

all

select

'c' ,null,' ',30090190,430.58,100502

union

all

select

'c' ,null,' ',30092371,589.93,100502

union

all

select

'c' ,null,' ',30092550,1198.6,100502

select

* from @t

-------------------------------

file snapshot.

bit hard if don't have static header/footer information.

see -  http://agilebi.com/jwelch/2008/02/08/adding-headers-and-footers-to-flat-files/


-vaibhav chaudhari



SQL Server  >  SQL Server Integration Services



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

BizTalk Server 2013 Azure VM Log Shipping and HA for hosts

How to send non-standard Content-Type header ?