Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003
    Location
    South Africa
    Posts
    71

    Unanswered: bcp command to give colums

    Can someonte tell me that if i
    bcp bda..mytable out c:\discounts.xls -c -p , how can I put the first row as my column names since I get only data

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    It won't...but there are other ways aroung it..you can use query out and supply a union like

    SELECT 'col1','col2','col3'...
    UNION ALL
    SELECT Col1,col2,col3 FROM myTable99

    Just need to make sure you're dfatatypes are converted to varchar

    What about DTS to an EXCEL, or csv?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Nov 2003
    Location
    South Africa
    Posts
    71

    bcp command to give colums

    Thanks very much it worked like magi

    Originally posted by Brett Kaiser
    It won't...but there are other ways aroung it..you can use query out and supply a union like

    SELECT 'col1','col2','col3'...
    UNION ALL
    SELECT Col1,col2,col3 FROM myTable99

    Just need to make sure you're dfatatypes are converted to varchar

    What about DTS to an EXCEL, or csv?

Posting Permissions

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