Main Page | Report this Page
Computers Forum Index  »  Computer - Databases - MS SQL Server  »  bcp & DB name with embedded blank...
Page 1 of 1    

bcp & DB name with embedded blank...

Author Message
jtaylor...
Posted: Thu Oct 08, 2009 2:28 pm
Guest
I'm trying to use "bcp" on a SQL Server database whose name contains
an embedded blank. I tried everything I can think of, but cannot find
the correct syntax.

Any ideas?
 
jtaylor...
Posted: Thu Oct 08, 2009 3:02 pm
Guest
Yes. I tried:
bcp [dataBase Name].dbo.table out PC.file -nT -S host\instance
and it returned:
Copy direction must be either 'in', 'out' or 'format'.



On Oct 8, 9:40 am, Plamen Ratchev <Pla... at (no spam) SQLStudio.com> wrote:
Quote:
Did you try [Database name]?

--
Plamen Ratchevhttp://www.SQLStudio.com
 
Plamen Ratchev...
Posted: Thu Oct 08, 2009 6:40 pm
Guest
Did you try [Database name]?

--
Plamen Ratchev
http://www.SQLStudio.com
 
Plamen Ratchev...
Posted: Thu Oct 08, 2009 9:09 pm
Guest
If you read the BOL extract I posted it says to use "":

bcp -q "dataBase Name.dbo.table" out PC.file -nT -S host\instance

--
Plamen Ratchev
http://www.SQLStudio.com
 
jtaylor...
Posted: Fri Oct 09, 2009 9:01 pm
Guest
Same error, I'm afraid.


On Oct 8, 12:09 pm, Plamen Ratchev <Pla... at (no spam) SQLStudio.com> wrote:
Quote:
If you read the BOL extract I posted it says to use "":

bcp -q "dataBase Name.dbo.table" out PC.file -nT -S host\instance

--
Plamen Ratchevhttp://www.SQLStudio.com
 
Erland Sommarskog...
Posted: Fri Oct 09, 2009 9:09 pm
Guest
jtaylor (jtaylor at (no spam) lorencook.com) writes:
Quote:
On Oct 8, 12:09 pm, Plamen Ratchev <Pla... at (no spam) SQLStudio.com> wrote:
If you read the BOL extract I posted it says to use "":

bcp -q "dataBase Name.dbo.table" out PC.file -nT -S host\instance

Same error, I'm afraid.

The quotes should be around the database name, not the entire specification.
I just ran this command successfully on my machine:

bcp "outer space".dbo.klafs out slask.bcp -q -T -n


--
Erland Sommarskog, SQL Server MVP, esquel at (no spam) sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
 
Plamen Ratchev...
Posted: Sat Oct 10, 2009 1:11 am
Guest
The problem was actually that the -q option was listed before the table. It is required to have the options after the
table. This should work fine:

bcp "dataBase Name.dbo.table" out PC.file -n -T -q -S host\instance

--
Plamen Ratchev
http://www.SQLStudio.com
 
jtaylor...
Posted: Wed Oct 21, 2009 9:59 pm
Guest
That works. Thanks!

On Oct 9, 4:11 pm, Plamen Ratchev <Pla... at (no spam) SQLStudio.com> wrote:
Quote:
The problem was actually that the -q option was listed before the table. It is required to have the options after the
table. This should work fine:

bcp "dataBase Name.dbo.table" out PC.file -n -T -q -S host\instance

--
Plamen Ratchevhttp://www.SQLStudio.com
 
 
Page 1 of 1    
All times are GMT
The time now is Sat Dec 05, 2009 5:48 am