Results 1 to 2 of 2

Thread: BCP utility

  1. #1
    Join Date
    Oct 2003
    Posts
    83

    Unanswered: BCP utility

    In the process of exporting data from SQL data file to text file through BCP utility I am not getting the Column names.How can I get the column names through BCP utility?
    I used this script
    exec master..xp_cmdShell 'bcp "select * from regulator.dbo.TEMPTBLBRANCHNOTUPLOAD" QueryOUT \\indiadb\ftproot\CLIENT_BRANCH_UPLOAD\branchnotup loaded.csv -S indiadb -U sa -P sasocrates -k -r \n -c -t "," -q'

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    It doesn't...did you look at BOL?

    You can however "fake it out"

    It would require a view or using QUERYOUT...

    Something like

    SELECT 'HEADING1','HEADING2',ect
    UNION ALL
    SELECT Col1, Col2, ect
    FROM yourTable

    Just make sure you CONVERT everyhting to varchar....
    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.

Posting Permissions

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