| Computers Forum Index » Computer - Databases - MS SQL Server » bcp & DB name with embedded blank... |
|
Page 1 of 1 |
|
| 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? |
|
|
| Back to top |
|
|
|
| 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:
|
|
|
| Back to top |
|
|
|
| Plamen Ratchev... |
Posted: Thu Oct 08, 2009 6:40 pm |
|
|
|
Guest
|
|
| Back to top |
|
|
|
| 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 |
|
|
| Back to top |
|
|
|
| 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 |
|
|
| Back to top |
|
|
|
| Erland Sommarskog... |
Posted: Fri Oct 09, 2009 9:09 pm |
|
|
|
Guest
|
|
| Back to top |
|
|
|
| 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 |
|
|
| Back to top |
|
|
|
| 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 |
|
|
| Back to top |
|
|
|
|