bulk insert problem

  • hi

    text file so

    005283 BAK? BA? S?HIYY? IDAR?SI 2 100 00010130606 1000 000 000 000 000 1000 1

    020200*AVIRTEL MMC 2 000 3803710 -200 000 000 000 000 -200 0

    1--- I created a table

    CREATE TABLE idare_abune

    (Test char(6), Test1 char(60), Test2 char(2), Test3 char(4),

    Test4 char(26), Test5 char(11), Test6 char(12),

    Test7 char(8), Test8 char(7), Test9 char(7),

    Test10 char(11), Test11 char(5), Test12 char(7),Test13 char(3))

    2--------- I created a fmt file

    exec xp_cmdshell

    'bcp ats342.dbo.idare_abune format nul -S XIRDALAN-SERVER -f "c:\temp\idare_abun.fmt" -c -T'

    3----------I changed fmt file

    '\t' to ''

    4----

    BULK INSERT idare_abune

    FROM 'C:\Documents and Settings\?????????????\??????? ????\obrabotka\OBOROTKA-092.list.txt'

    WITH

    (

    FORMATFILE = 'c:\temp\idare_abun.fmt'

    )

    -----------------

    i get error

    -------

    The statement has been terminated.

  • you should post the entire error, especially the error number.

    i'll bet this is security related...cant find file or some error like that.

    the reason: 'C:\Documents and Settings\ all folders there are private, and require elevated permissions to read from there.

    unless you've set sql server service to start as yourself or as an administrator, it can't see files on your personal desktop/my documents etc.

    move the files to c:\Data or something and try again.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

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

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