0

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.InventoryValuation_FP102008" out D:\test.txt -q -T -c'

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

Many thanks.

2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by RDWilson2
0

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.InventoryValuation_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.InventoryValuation_FP102008 out D:\test.txt -q -T -c'

It returned this error msg:

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


Thanks!

0

Have you considered simply not having the space in the name? Instead, try substituting an underscore ("_").

In my experience, having a space in a table/column/stored procedure/file/pretty much anything else name is asking for problems like this.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.