bcp Utility

  • Hi,

    I am trying to output the query results to an excel file on the LAN.

    I get a usage error message as follows when I try this statement through the QA.  I don't know what parameters/Arguments I am missing.

     

    usage: bcp {dbtable | query} {in | out | queryout | format} datafile

    This is the statement I am using

    exec master..xp_cmdshell 'bcp "select * from Database.tableName" queryout

    \\UNCPath.xls -c -S ServerName -T'

     

    Any help is greatly appreciated

    KR

  • Just a guess, because I'm not at a place to try it out, but the UNCname may need quotes.


    And then again, I might be wrong ...
    David Webb

Viewing 2 posts - 1 through 1 (of 1 total)

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