Solved

bcp command failed

Posted on 2006-06-29
7
425 Views
Last Modified: 2012-08-14
Hi,
I has run bcp command as below in cmd prompt.

bcp "externalFF.tempsn" out "tempsnxx.txt" -c -q -U"sa" -P"BruderX4$",

however it return with error msg as below, I had run this at CMD windows in the server that run the database engine.

SQLState = S0002, NativeError = 208
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'externalFF
.tempsn'.
0
Comment
Question by:motioneye
  • 5
  • 2
7 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 17015190
bcp dbName.owner.TableName  out  completepath\Filename  -c -q  -Usa -PBruderX4$

here is an example

BCP Northwind.dbo.Categories out c:\categories.txt -n -Smyservername -Usa -PBruderX4$
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 17015194
I missed to specify the servername in your query

bcp dbName.owner.TableName  out  completepath\Filename  -c -q  -Usa -PBruderX4$ -Smyservername
0
 

Author Comment

by:motioneye
ID: 17015437
Hi,
How could I use this file agaib to get it insert into other tables?? how do I use bcp insert here?
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 17015581
You can do this in the following way, you need to replace the 'out' with 'in', in your above query

BCP Northwind.dbo.Categories in c:\categories.txt -c -Smyservername  -Uusername - Ppassword
0
 

Author Comment

by:motioneye
ID: 17015913
Ok,
I got it, so mean to get it transfer to another table that have same column and data type, I should not define the indexes or any constraints earlier, this has to be done right after the data was bcp in...

am I rite???
0
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 500 total points
ID: 17015999
motioneye,
>  I should not define the indexes or any constraints earlier

Not always true. But the Better option is to continue as you mentioned..

:)
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 17016342
Thanks for Grade 'B'

Please re-read the EE Guidelines regarding grading Standards at:

What's the right grade to give?
http://www.experts-exchange.com/Databases/Microsoft_SQL_Server/help.jsp#hi73

And in particular this section:

<quote>
C: Because Experts' reliability are often judged by their grading records, many Experts would like the opportunity to clarify if you have questions about their solutions. If you have given the Expert(s) ample time to respond to your clarification posts and you have responded to each of their posts providing requested information; or if the answers, after clarification, lack finality or do not completely address the issue presented, then a "C" grade is an option. You also have the option here of just asking Community Support to delete the question.
Remember, the Expert helping you today is probably going to be helping you next time you post a question. Give them a fair chance to earn an 'Excellent!' grade and they'll provide you with some amazing support. It's also true that a "C" is the lowest grade you can give, and the Experts know that -- so use it judiciously.

Only the Moderators and Page Editors have the choice to give a D grade. Beyond that, in a practical sense, the grading guidelines have "softened" a bit over the last year or two; one might expect that the majority of grades would be Bs (a standard "bell" curve), but the fact is that the culture of the site has caused there to be an inordinately high percentage of As. The Moderators have been instructed to ensure that the As they award are actually "Excellent" answers. Similarly, the C grade is the lowest that can be given by a member, a fact which should be kept in mind when grading as well.

The use of a C in a vindictive manner is likely to be changed by a Moderator. You may not like the answer you get, and in some cases, and you may not like the way it is delivered, but if it is deemed to be accurate, no less than a B is an acceptable grade.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now