Wrox Programmer Forums
|
SQL Server 2005 General discussion of SQL Server *2005* version only.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 3rd, 2007, 05:16 PM
Authorized User
 
Join Date: Nov 2003
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default SSIS - imoprt ASCII file

Hi,

im trying to create a DTS in the SSIS.
I need to import an ASCII file to a table.
the problem is that I cant seem to import an ascii file which his rows has different size.
the flat file columns are ; delimited.

how can i do it ?

Thank you
Yuval
__________________
Yuval Kronenfeld
Israel
 
Old January 11th, 2007, 12:40 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

In SSIS, click data flow tab then select flat file source from the data flow sources

Jaime E. Maccou
 
Old January 11th, 2007, 10:02 AM
Authorized User
 
Join Date: Nov 2003
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Jaime ,

I used that.
the flat file source know how to handle comma delimaited files but only when the rows size is identical (meaning all rows has equal number of columns).
I have in the first row for example 10 columns and in the next rows 20 columns.
SSIS cant handle it as much as I tried.

any ideas ?
 
Old January 11th, 2007, 01:26 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

can you share the file contents or sample to evaluate your situation?


Jaime E. Maccou
 
Old January 11th, 2007, 02:03 PM
Authorized User
 
Join Date: Dec 2006
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Default

SSIS Flat File connection manager is expecting an equal number of columns in each line.

With the high level description you provided, you will need to either preprocess or post process the file.
Pre Process... Make all the rows uniform.
Post process... Change the connection manager to import each row as one string (i.e. set the column delimeter to {CR}{LF} and adjust the column width to a large enough size not to truncate any given row.) Depending on the row of data, you can then transform the row using a Derive Column or Script Component. Or, you could import the file into a stage table and T-SQL/.NET transform the row.

Good Luck!


Adam Gossage
Lake Wylie, SC, USA
 
Old January 18th, 2007, 05:41 AM
Authorized User
 
Join Date: Nov 2003
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Adam,

Thank you.
You actually told me what I was afraid to hear.
I hate it when microsoft release a new version which has downgrades compare to the old version.
in sql 2000 it was so easy...:)

Thank you,

Yuval





Similar Threads
Thread Thread Starter Forum Replies Last Post
SSIS - Flat file to OLEDB Destination carumuga SQL Server DTS 0 September 1st, 2008 10:13 AM
Writting to an ASCII File from VB6 no quotations kf4rrm VB How-To 2 April 21st, 2006 03:32 PM
Display ASCII file using xsl... bmagadi XSLT 0 February 10th, 2005 07:52 AM
Write ASCII text file muklee C# 1 December 12th, 2004 09:40 PM
Reading ASCII data from text file. LordBeholder VB How-To 2 June 25th, 2004 05:50 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.