BCP error on a database with name in two words

Please support our MS SQL advertiser: Intel Parallel Studio Home
Reply

Join Date: Jul 2008
Posts: 2
Reputation: ggk517 is an unknown quantity at this point 
Solved Threads: 0
ggk517 ggk517 is offline Offline
Newbie Poster

BCP error on a database with name in two words

 
0
  #1
Jul 24th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 2
Reputation: ggk517 is an unknown quantity at this point 
Solved Threads: 0
ggk517 ggk517 is offline Offline
Newbie Poster

Re: BCP error on a database with name in two words

 
0
  #2
Jul 24th, 2008
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!
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 15
Reputation: RDWilson2 is an unknown quantity at this point 
Solved Threads: 0
RDWilson2 RDWilson2 is offline Offline
Newbie Poster

Re: BCP error on a database with name in two words

 
0
  #3
Jul 24th, 2008
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC