Bulk insert with defualt values

  • hi

    i had a txt file like D:\db.txt with data

    12~the

    13~hello

    and i created a table

    create table abc

    (

    a varchar(20),

    b varchar(12),

    c int default 0

    )

    bulk insert abc

    from 'D:\db.txt'

    with

    (

    fieldterminator='~',

    rowterminator=''

    )

    With out column c the txt file is uploading nice but when i use column c it showing error...

    Any idea?

  • What is the exact wording of the error?

    --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.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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