Error in bcp command execution on Query Analyzer

  • Hi,
    I have the following problem:
    I´m trying to execute a bcp command on Query Analyzer, for e.g.:
     
    bcp database..table out c:\file.txt -Sserver -Usa -Pmaster -fc:\format.fmt
     
     
    And the Query Analyzer return the following message error:
     
    Server: Msg 170, Level 15, State 1, Line 1

    Line 1: Incorrect syntax near '.'.

     
    If I try to execute the same command with the bcp.exe, the result is Ok.
     
    Somebody have a idea?
     
    Thanks for all help! 🙂
     
  • you need call xp_cmdshell in QA to run the bcp.

    declare @strCMD varchar(100)

    select @strCMD = 'bcp db..table out ..... '

    exec master..xp_cmdshell @strCMD

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

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