Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2009
    Posts
    3

    Unanswered: bcp csv import error

    Hello need help bcp import data
    with datetime format
    i create temprorary table with varchar column and try to convert this '20081031115548' to datetime format does not work.
    any nice idea i have 10 millions of data to insert it
    i am not success in bcp and couldnot create insert then i am
    using vb application it is too slow time out occurs often.

    original csv date is like this
    0019,20081130,081104686,1,000001,01,20081130110152 ,2,530,,0,0.0000,0,530,0,0,530,600,70,505,,1,1,,1, ,0,,20081130110254,20081130110255,C0019F02,3003284 6,20062263,

    here is the sample date plz help.
    lalupate

  2. #2
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    To convert your char to datetime use e.g.
    select convert(datetime, stuff(stuff(stuff('20081031115548', 13,0,':'), 11,0,':'), 9,0,' '))

  3. #3
    Join Date
    Mar 2009
    Posts
    3

    thanks for response pdreyer,

    Quote Originally Posted by pdreyer
    To convert your char to datetime use e.g.
    select convert(datetime, stuff(stuff(stuff('20081031115548', 13,0,':'), 11,0,':'), 9,0,' '))
    it works for one datetime format but problem is how to use wildcard millions of different char data at once,
    or changing csv file to insertable format.

    thanks again

  4. #4
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    I don't understand. You mean you don't have only ccyymmddhhmmss as a problem format? Your sample csv data has only this one problem format.
    You can try to modify the csv file using something like awk (or maybe sed)
    How is this file created? Can you not get it modified at the source?

  5. #5
    Join Date
    Mar 2009
    Posts
    3

    thanks again for the response

    yeah, it is good idea ,hope will solve the problem using awk or sed.
    these data is created by vb application retrive from ASA server in csv format and again vb application
    insert or update to ase server. these process is ok for few data and daily routing basis, but in my case there is large size of data(2 -3 years ) thus takes few days.
    so i was thinking not to use VB aplication
    csv direct to ase using bcp
    thats why i was looking for solution.

    thanks
    lalupate

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •