BCP error on a database with name in two words

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ggk517
    New Member
    • Jul 2008
    • 2

    BCP error on a database with name in two words

    Hi,

    Why a database with two words separated by a space causes problem to a bcp command like below :

    EXEC xp_cmdshell 'bcp [History Data].dbo.InventoryV aluation_FP1020 08" out D:\test.txt -q -T -c'

    Do you guys met with the same problem before? If yes, how to solve it.

    Many thanks.
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    If that's your actual command, I think you have a problem with the quotes, not the database name.

    -- CK

    Comment

    • ggk517
      New Member
      • Jul 2008
      • 2

      #3
      Sorry i think there is a typo (the " should not be exist) in my earlier post. Pls read below for further info:


      This command works perfectly :-

      EXEC xp_cmdshell 'bcp History.dbo.Inv entoryValuation _FP102008 out D:\test.txt -q -T -c'

      But, if i renamed the database from "History" to "History Data" and ran this command :-

      EXEC xp_cmdshell 'bcp [History Data].dbo.InventoryV aluation_FP1020 08 out D:\test.txt -q -T -c'

      It returned this error msg:

      Copy direction must be either 'in', 'out' or 'format'.


      Thanks!

      Comment

      Working...