Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

bcp command failed

Posted on 2006-06-29
7
428 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

808 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