Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2003
    Posts
    54

    Unanswered: BCP blank header line

    I am using BCP to export the contents of a view into a text file. Everything is running jsut ifne, except the resulting file has a blank first line. Is there a way to preven this?

    BCP statement is as follows:

    bcp "select pospay from son_db.dbo.vw_pos_pay order by account desc, code asc" queryout D:\elite\USbank\PositivePay_Current\x340.d150364i. d100.txt -T -c

    Thanks in advance for any help!

  2. #2
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    probably the first row is a NULL. is the pospay column nullable? if so you can add a where clause to your query to omit the null.

  3. #3
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    You can take help of :-F first_row Specifies the number of the first row to export from a table or import from a data file. This parameter requires a value greater than (>) 0 but less than (<) or equal to (=) the total number rows. In the absence of this parameter, the default is the first row of the file.
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

  4. #4
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    that only matters for importing data, Satya. the OP is exporting.

  5. #5
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    Jezemine
    Look at the BOL entry I've pasted there: Specifies the number of the first row to export from a table or import from a data file
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

Posting Permissions

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