Reading flat file and cretaing meta data

  • Hi All

    I am stuck in this situation where I need to read flat file (comma/Pipe separated) and

    create meta data (tore information into table) for it. \

    for example:-

    1. Number of records in file

    2. Record Date from

    3. Record Date to

    4. File name, date and time

    could this possible doing using BCP or within SQL erver??? Please help..

    sample file data:

    57001, 9/14/04, 5:04, 6:22 ,p,45 ,p,36 , ,   , ,

    57001, 9/14/04, 6:22, 7:13 ,p,45 ,p,35 , ,   , ,

    57001, 9/14/04, 7:26,      ,p,45 ,p,36 , ,   , ,

    57064, 9/14/04, 7:00, 8:30 ,p,390,p,82 ,p,247, ,

    57079, 9/14/04, 8:00,      ,p,29 ,p,63 ,p,247, ,

    57086, 9/14/04, 6:29, 8:12 ,p,3  ,p,62 , ,   , ,

    57086, 9/14/04, 8:15,      ,p,3  ,p,62 , ,   , ,

    57087, 9/14/04, 7:01,      ,p,3  ,p,62 ,p,5  , ,

    OR

    56943215|0|10|0|51|120|11/13/2004|22:28:02|11/13/2004|22:30:02|46|0|0|604|130|476|130|-1|-1|61|1|0|1|0|0|0|0|0|0|0|0|1|1|1|2|4|1|1|0|0|1|0|0|0|0|0|0|0|0|0|00000000000000000000|32104|01C13010|28079||38086||28079|8312420151|0||00||||||

    56943215|0|0|6|19|19|11/13/2004|22:29:43|11/13/2004|22:30:02|0|0|0|644|130|621|-1|-1|-1|0|0|1|0|0|0|0|0|0|0|0|0|0|0|1|3|0|0|2|0|0|0|0|0|0|0|0|0|0|0|0|00000000000000000000|32113||32223|38086|||32223|38086|||||||||

    |0|0|0|1|2|4|0|1|0|0|1|0|0|0|0|0|0|0|0|0|00000000000000000000|15476|01C13020|28346||10890||28346|6034635955|378364786994008||00||||||

    Thanks in advance......

    swarn

    SqlIndia

  • from DTS you can tranfer flat files to table




    My Blog: http://dineshasanka.spaces.live.com/

  • Thanks Dinesh... I knew this that transfer can possible using either DTS or BCP. But I have to store above information about flat file into table.. how i do as I am new in it..

      

    SqlIndia

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply