|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, April 14, 2010 4:01 AM
Points: 1,
Visits: 11
|
|
Hi,
I have a flat file without delimiters. The format is like L10123444 221 but Col1 = L;col2=1;col3=0123444 etc...
how to import this kind of flat file
Thanks in advance
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Friday, February 22, 2013 9:30 PM
Points: 912,
Visits: 198
|
|
Use fixed length option in flat file connection manager
My Blog: http://dineshasanka.spaces.live.com/
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Tuesday, May 07, 2013 11:02 AM
Points: 1,073,
Visits: 6,321
|
|
In the SSIS Data Flow you would use a Flat File Source. Configure the sources connection manager to use the "Ragged right" format and mark where the columns should be delimited, including the appropriate row delimiter. In the Advanced options change the properties for each column, such as Column name, data type and width. Then connect that to your destination.
If the fields won't be in the same position and same width the above won't work. For that you could still use a Flat File Source and read each row to a single column, then split that row up within a Script Component.
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 7:51 PM
Points: 32,910,
Visits: 26,800
|
|
karthi (2/25/2008) Hi,
I have a flat file without delimiters. The format is like L10123444 221 but Col1 = L;col2=1;col3=0123444 etc...
how to import this kind of flat file
Thanks in advance
All of the methods suggested, so far, are good and will do.
If you want absolute blinding speed, though, using Bulk Insert with a BCP format file will out perform just about anything else you can do. The information for a BCP format file is in Books Online.
--Jeff Moden "RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".
First step towards the paradigm shift of writing Set Based code: Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."
For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
|
|
|
|