Author |
Topic |
jung1975
Aged Yak Warrior
503 Posts |
Posted - 2003-04-29 : 19:44:56
|
I am trying to run following BCP command on my Local machine.( using Sa password). C:\> bcp pubs..jobs out jobs.txt -c -U sa -PBut, I keep getting error message:SQLState = 08001, NativeError = 17Error = [Microsoft][ODBC SQL Server Driver][Shared Memory]SQL Server does not exist or access denied.SQLState = 01000, NativeError = 2Warning = [Microsoft][ODBC SQL Server Driver][Shared Memory]ConnectionOpen <Connect<>>.I am not sure what I am doing wrong??? |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2003-04-29 : 19:58:36
|
You haven't supplied the -S switch. If you are running it on the server (if your client is also the server), then you can run this:bcp pubs..jobs out jobs.txt -c -U sa -P -S (local)Or change (local) to the actual server name, such as:bcp pubs..jobs out jobs.txt -c -U sa -P -S ServerName1If you will still get the error, then you need to try connecting to the server through Query Analyzer to see if you get an error there.Just so that you know, the error that you are getting is a connectivity problem and not specifically a bcp problem.TaraEdited by - tduggan on 04/29/2003 19:59:36 |
 |
|
jung1975
Aged Yak Warrior
503 Posts |
Posted - 2003-04-29 : 20:15:04
|
Tara:As a personal question...You seems to be the same age as mine. I was wondering How did you become so knowledgeable in SQL Server(Study after Study? ). I am currently working as a Junior SQL Server DBA and trying to improve my skills in order to become a senior SQL Server DBA. Can you share some tips or your persoanl experience with me?ThanksJung |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2003-04-29 : 20:24:17
|
I actually was a student worker in the DBA team at my first job while in my third year of college. After I graduated (B.S. in Math with emphasis in C.S.), they hired me on full-time. Shortly thereafter, the IT department was outsourced to a huge company. I later left that company so that I could work at the company that I am at now. At all three companies, I gained different aspects of the database world so it has pretty much left me pretty well-rounded in the DBA field (I'm still missing some stuff though).So I was a junior DBA (working on SQL Server 4.2 and 6.5!) at about age 20 and am now an Intermediate DBA (that's actually my title here). I probably won't get to senior knowledge for another year or two, but maybe it'll be quicker considering all of the knowledge I have gained at my current job and by reading SQLTeam stuff. I have only attended one SQL Server class, so all/most of my experience has been gained on the job. And it doesn't hurt to work for a great senior DBA who is willing to show me the ropes.TaraEdited by - tduggan on 04/29/2003 20:25:55 |
 |
|
fmazeika
Starting Member
3 Posts |
Posted - 2004-04-29 : 15:45:19
|
I tried your suggestion but it keeps failing, any other switches I can try. It works fine on a non sql cluster.Francis S. MazeikaData Modeler.Enterprise Applications.Dechert LLP.(215) 994-7074 Direct(215) 994-2000 FaxMailto:Francis.Mazeika@Dechert.comhttp://www.Dechert.com |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-04-29 : 15:48:03
|
Francis, What is the command that you are running? What is the error that you are getting?Tara |
 |
|
fmazeika
Starting Member
3 Posts |
Posted - 2004-04-29 : 15:50:56
|
Error:SQLState = 08001, NativeError = 17Error = [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.SQLState = 01000, NativeError = 2Warning = [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect()).NULLCommand exec master..xp_cmdshell 'C:\Progra~1\Micros~4\80\tools\binn\bcp.exe "select ActivityLogRec from Docs_13..ActivityLogTmp Where ActivityLogRec is not null" out k:\DocsOpen\ActivityLog\NPB_13\NPB_13_ActivityLog_4292004_946.txt -c -Ubcp -Pbcp -Sphint74'--phint74 is the server namei also tried exec master..xp_cmdshell 'C:\Progra~1\Micros~4\80\tools\binn\bcp.exe "select ActivityLogRec from Docs_13..ActivityLogTmp Where ActivityLogRec is not null" out k:\DocsOpen\ActivityLog\NPB_13\NPB_13_ActivityLog_4292004_946.txt -c -Ubcp -Pbcp -Sphint75\phint75'-- Sphint75\phint75 sql instance.Francis S. MazeikaData Modeler.Enterprise Applications.Dechert LLP.(215) 994-7074 Direct(215) 994-2000 FaxMailto:Francis.Mazeika@Dechert.comhttp://www.Dechert.com |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-04-29 : 15:53:31
|
You probably need to add an alias for phint74 using Client Network Utility. Try using -S(local) instead to see if that works if the server that you are connected to is the same server that you are trying to connect to with bcp. Also try running it from the database server in a cmd window instead of through xp_cmdshell.BTW, in a clustered environment you need to refer to the server with the clustered name and not the name of the server.For example, we have a node named Bean and another one named Ender. It's virtual name is HASDSQL. So when we want to connect to GTW instance, we specify HASDSQL\GTW. You use the virtual server name in case the instance moves to the other node.Tara |
 |
|
fmazeika
Starting Member
3 Posts |
Posted - 2004-05-05 : 10:34:11
|
I created a local alias in the client network utility and added the -S switch to my code, its working.Thanks for your help |
 |
|
dkn
Starting Member
3 Posts |
Posted - 2008-01-28 : 20:52:21
|
hello , it can't work although I modified code step by step according to what you saidwhich alias I would add? there are some selection such as Name pipe ,or TCP/IP and so onThanks a lot |
 |
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2008-01-28 : 21:01:16
|
What protocol does server use? |
 |
|
dkn
Starting Member
3 Posts |
Posted - 2008-01-28 : 22:22:05
|
It can work,but I do not confirm which solution refer to it,I add alias related to network libray "Named Pipes",command -S parameter is server name but not alias name,it can work, if I use alias name ,it do not work |
 |
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2008-01-28 : 22:26:42
|
Alias is not required. |
 |
|
dkn
Starting Member
3 Posts |
Posted - 2008-01-29 : 02:03:05
|
I have another problemSQLstate = 22005,NativeError=0Error=[Microsoft][ODBC SQL Server Driver] ????????????the -t parameter is "|" |
 |
|
|