Bulk Move between Databases

  • I would say that either the tables (PolicyProcessAudit2 and PolicyProcessAudit have different structures - one of columns in the first table is longer than column length in the other table, or the field "null as AuditXml" is causing problems. You may try to use: CAST(null as PutProperDataTypeHere) as AuditXml.

    The simplest test is to select just 1 record from the first table and insert it into second table (with INSERT ... SELECT statement).

    You may also try using "-c" parameter (instead of "-n").

    Marek

  • The table structures do match (except for indicies)....but I will try -c instead of -n

  • did you end up getting this to work? I am having a very similar issue!

  • On the truncation problem, everyone realizes that the table columns must be in the same cardinal order as the input file unless you use a format file, right?

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

  • What I don't like in Michael's query is this: "null as AuditXml". I would say that in this case SQL Server does not know what type is this field. I would rather cast NULL value to a specific type.

    Sara, just try to export only 1 row of data with -c option and check the export file. It can happen that some fields contain TAB, CR or LF characters, which confuse the server. If this is the case, you may need to specify different field/row termination characters.

    Marek

  • Actually, it turned out using -c solved my problem. For whatever reason, the -n did not work!

    thanks for your help guys.

Viewing 6 posts - 16 through 20 (of 20 total)

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