显示标签为“commandbcp”的博文。显示所有博文
显示标签为“commandbcp”的博文。显示所有博文

2012年3月11日星期日

bcp help

Hi!
Trying to run this command:
bcp Risk.dbo.tbl_Open in C:\temp2\2006.05.11-09.20.11.11\Risk\Open.txt
-T -n
getting the followin error message:
SQLState = 37000, Native Error = 156
Incorrect Syntax near the keyword 'Open'.
I can't not rename a table. Is there a work around?
Thanks,Are you executing this in Query Analyzer or from an operating system command
prompt. BCP is not a
TSQL command. If you want to run a TSQL command, use BULK INSERT instead.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"tolcis" <a.liberchuk@.verizon.net> wrote in message
news:1147370866.716078.250460@.i40g2000cwc.googlegroups.com...
> Hi!
> Trying to run this command:
> bcp Risk.dbo.tbl_Open in C:\temp2\2006.05.11-09.20.11.11\Risk\Open.txt
> -T -n
> getting the followin error message:
> SQLState = 37000, Native Error = 156
> Incorrect Syntax near the keyword 'Open'.
> I can't not rename a table. Is there a work around?
> Thanks,
>|||I am executing from DOS command.|||That is strange since the error complain on the keyword Open where your code
refers to a table named
tbl_Open. Anyhow, check out the -q option of bcp.exe.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message
news:OmydNdSdGHA.3484@.TK2MSFTNGP04.phx.gbl...
> Are you executing this in Query Analyzer or from an operating system comma
nd prompt. BCP is not a
> TSQL command. If you want to run a TSQL command, use BULK INSERT instead.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "tolcis" <a.liberchuk@.verizon.net> wrote in message
> news:1147370866.716078.250460@.i40g2000cwc.googlegroups.com...
>

2012年3月6日星期二

BCP Error Message

Hi All,
I am getting the below error message when I am executing the BCP command
BCP command
==========
xp_cmdshell 'c:\MSSQL7\BINN\BCP SQLManager.dbo.z_DBAdmin_Fwd_MAXDRBUS02_DBAdmin_db o_tbl_CheckServerRoleMembers_20040331161058 in "c:\Temp\DBAdmin_Fwd_MAXDRBUS02_DBAdmin_tbl_CheckS erverRoleMembers.bcp" /SSQLSER /UDUser /Ptest /c /b1000 /m1'
Error Message
==========
SQLState = 08001, NativeError = 6
Error = [Microsoft][ODBC SQL Server Driver][Named Pipes]Specified SQL server not found.
SQLState = 01000, NativeError = 53
Warning = [Microsoft][ODBC SQL Server Driver][Named Pipes]ConnectionOpen (CreateFile()).
Thanks & Regards
Balaji
Balaji (anonymous@.discussions.microsoft.com) writes:
> I am getting the below error message when I am executing the BCP command
> BCP command
>==========
> xp_cmdshell 'c:\MSSQL7\BINN\BCP SQLManager.dbo.z_DBAdmin_Fwd_MAXDRBUS02_DBAdmin_db o_tbl_CheckServerRoleMembers_20040331161058 in "c:\Temp\DBAdmin_Fwd_MAXDRBUS02_DBAdmin_tbl_CheckS erverRoleMembers.bcp" /SSQLSER /UDUser /Ptest /c /b1000 /m1'
> Error Message
>==========
> SQLState = 08001, NativeError = 6
> Error = [Microsoft][ODBC SQL Server Driver][Named Pipes]Specified SQL server not found.
> SQLState = 01000, NativeError = 53
> Warning = [Microsoft][ODBC SQL Server Driver][Named Pipes]ConnectionOpen (CreateFile()).
That means that BCP cannot find the server you are trying to connect to.
Why it cannot do so, I have no idea. To start with, you have not provided
any information on why you should be able to connect to this server.
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp