Hi..im trying to use BCP to transfer data from text file to a SQL table and
give me an error. I have access to the db table with the 'sa' user and both
input and format files are in the directory. This was working well, but
suddenly stop working.
This is the complete command and the error at the prompt:
--COmmand--
C:\>bcp dt..hc990021 in e:\dtracker\dtdata30\33600001032002990.or1
-fe:\dtracker\dtdata30\HC990021.fmt -b5000 -F1 -Usa -P -h
--error--
SQLState = 08001, NativeError = 17
Error = [Microsoft][ODBC SQL Server Driver][Shared Memory]SQL Se
rver does
not exist or access denied.
SQLState = 01000, NativeError = 2
Warning = [Microsoft][ODBC SQL Server Driver][Shared Memory]Conn
ectionOpen
(Connect()).
Any idea..?
CARLOS BREA
PUERTO RICOYou have NOT specified the "-S server_name[\instance_name]" option.
This specifies the instance of SQL Server to connect to. If no server is
specified, bcp connects to the default instance of SQL Server on the local
computer. If you do not have a default instance and instead have a NAMED
instance, then this option is required. Also, this option is required when
executing bcp from a remote computer on the network.
Reference:
Books Online topic: bcp Utility
Fany Vargas
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
Are you secure? For information about the Strategic Technology Protection
Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.
Microsoft highly recommends that users with Internet access update their
Microsoft software to better protect against viruses and security
vulnerabilities. The easiest way to do this is to visit the following
websites:
http://www.microsoft.com/protect
http://www.microsoft.com/security/guidance/default.mspx|||I have several named instances...the issue is that this bcp command was
working before setup of the DNS entries. Is any relation of this with the
failure.//?
How can I specified a specific default named instances in my SQL server, to
not have to use the -S flag at the command? I have a program that generate
the bcp command and didnt specify the -s flag. What I have to do to use the
bcp withut the -s flag?
Thanks.,..
"Fany Vargas [MSFT]" wrote:
> You have NOT specified the "-S server_name[\instance_name]" option.
> This specifies the instance of SQL Server to connect to. If no server is
> specified, bcp connects to the default instance of SQL Server on the local
> computer. If you do not have a default instance and instead have a NAMED
> instance, then this option is required. Also, this option is required when
> executing bcp from a remote computer on the network.
>
> Reference:
> Books Online topic: bcp Utility
> Fany Vargas
> Microsoft Corporation
> This posting is provided "AS IS" with no warranties, and confers no rights
.
> Are you secure? For information about the Strategic Technology Protection
> Program and to order your FREE Security Tool Kit, please visit
> http://www.microsoft.com/security.
> Microsoft highly recommends that users with Internet access update their
> Microsoft software to better protect against viruses and security
> vulnerabilities. The easiest way to do this is to visit the following
> websites:
> http://www.microsoft.com/protect
> http://www.microsoft.com/security/guidance/default.mspx
>|||You have to specify the -S flag to connect to a named instace. If you have
a default instance which is running (service is not stopped) then excluding
the -S specifies to connect to this default instance. The only possible way
(it may not even work) I can see where you can get the BCP command to work
without the -S command and force it to connect to a named instance is to
create a client alias with name "." and point it your named instance. So
for example:
start->run->cliconfg.exe->alias tab->Add
aliasname = .
servername=sqlservername\instancename
you can also try alias:
aliasname = (local)
servername=sqlservername\instancename
but keep in mind that would force any other applications on this machine
which try to connect using "." notation to now connect to the named
instance you pointed it too instead of the default instance. So the best
option would be to have your application create the bcp command correctly.
Fany Vargas
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
Are you secure? For information about the Strategic Technology Protection
Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.
Microsoft highly recommends that users with Internet access update their
Microsoft software to better protect against viruses and security
vulnerabilities. The easiest way to do this is to visit the following
websites:
http://www.microsoft.com/protect
http://www.microsoft.com/security/guidance/default.mspx
没有评论:
发表评论