BCP .fmt for Fixed Length

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • benchpolo
    New Member
    • Sep 2007
    • 142

    BCP .fmt for Fixed Length

    /*START: Bulk insert data into Tables: EZCAP1.1400_byt e_layout.dbo.BO W_Received*/
    --create format file for bulk insert
    set @sCmd='bcp [1400_byte_layou t].dbo.BOW_Receiv ed format nul -f \\arcsan\vol2\S HARE\EDI\Randy\ BOW_Received.FM T -SEZCAP1 -T -c -t";"'
    exec master..xp_cmds hell @sCmd


    8.0
    10
    1 SQLCHAR 0 1 ";" 1 FILLER SQL_Latin1_Gene ral_CP1_CI_AS
    2 SQLCHAR 0 9 ";" 2 ACCTNO SQL_Latin1_Gene ral_CP1_CI_AS
    3 SQLCHAR 0 10 ";" 3 SERIALNO SQL_Latin1_Gene ral_CP1_CI_AS
    4 SQLCHAR 0 41 ";" 4 AMOUNT ""
    5 SQLCHAR 0 6 ";" 5 ISSUEDATE SQL_Latin1_Gene ral_CP1_CI_AS
    6 SQLCHAR 0 6 ";" 6 PAIDDATE SQL_Latin1_Gene ral_CP1_CI_AS
    7 SQLCHAR 0 8 ";" 7 SEQNO SQL_Latin1_Gene ral_CP1_CI_AS
    8 SQLCHAR 0 50 ";" 8 LOCATION SQL_Latin1_Gene ral_CP1_CI_AS
    9 SQLCHAR 0 1 ";" 9 RECTYPED SQL_Latin1_Gene ral_CP1_CI_AS
    10 SQLCHAR 0 24 "\r\n" 10 UPDATEDON ""


    Does the above .fmt works for Fixed length format? Thanks.
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Here's the explanation of how format files work.

    -- CK

    Comment

    Working...