question

artistlover avatar image
artistlover asked

How can i create pipe delimited text file in SSIS.

Program ID|Date Received|RZA|Dealer No|Dealer Name|Part Number|Claim Number|Paid|Pending|Paid Date|Status|Fund|Fund Year|ROInvoiceNum|ROInvoiceDate|Submitter|number of ads|FilenumberIN|Customer Type|Customer Name|Customer Address|Customer City|Customer State|Customer Zip|AmtCharged RO|Competitor Name|Compeitor Price OP|2/23/2015|1011155152|173036|aaa|aa|1aa|$100.00|$0.00|3/19/2015|Paid|15 CONQUEST|2015|618648|2/20/2015|NULL|1||Ind. Service Center|aa|||Select a s||2013.13||0.00 how can i do this in ssis. I have some created similar but they are excel not pipe delimited text. the package runs a stored procedure to populate sql table. It then inserts into the .txt file.
ssis
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
nidheesh.r.pillai avatar image
nidheesh.r.pillai answered
Easy! just configure the Flat file connection manager settings. In the Connections Manager, open the Flat file connection manager, goto Columns, and specify the Column Delimiter to use the '|' symbol. Only glitch is that you cannot see the column-header names in such a setting. To see the column names as well as per you question, I reformatted the query a bit in this fashion- SELECT 'ID' as ID, 'EmployeeName' as EmployeeName, 'PhoneNumber' as PhoneNumber UNION ALL SELECT CAST([ID] as varchar) as ID ,[EmployeeName] ,CAST([PhoneNumber] as varchar) as PhoneNumber FROM [TestDatabase].[dbo].[Employee] and this is what I get as output. ID|EmployeeName|PhoneNumber 1|Rajesh Mukherjee|11111 2|Anjana Singh|22222 3|Anil Tewari|33333 This matches the requirement you need. Hope this helps!
3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

nidheesh.r.pillai avatar image nidheesh.r.pillai commented ·
In the source of the data flow task. As I understand you, you have a SQL table whose data you need to insert into the txt file, right?. This will be your source.
2 Likes 2 ·
artistlover avatar image artistlover commented ·
where do you put the query?
0 Likes 0 ·
artistlover avatar image artistlover commented ·
oh gosh don't i feel stupid. Sorry.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.