SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 BCP in
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mayaaa
Starting Member

15 Posts

Posted - 08/09/2012 :  20:54:33  Show Profile  Reply with Quote
Hi,

I'm trying to load a small txt file into a SQL table.. would really appreciate it if someone could help me.
I'm using the BCP in command in cmd but I get this error message:

C:\>bcp Resolvit.Simple_EH_Forecast in C:\bb\test.txt -c -S test
-PC\SQLEXPRESS -T -F 2 -e
SQLState = S0002, NativeError = 208
Error = [Microsoft][SQL Server Native Client 10.0][SQL Server]Invalid object nam
e tapuz.test'.


Thank you!!

xhostx
Constraint Violating Yak Guru

USA
261 Posts

Posted - 08/10/2012 :  09:10:34  Show Profile  Reply with Quote
try this, but keep in mind that all data will be copied into one column. if you need to copy into a table that is composed of many columns use bulk insert instead.

eg:
bcp DBname..TableName in c:\folder1\folder2\test.txt /c /U /P /r\n


make sure that you have the right credentials (U is the user eg: /Usa) and (P is the password eg: /Ppass).

You may want to look at the your role account under security to make sure your have all privileges to bcp.

--------------------------
Joins are what RDBMS's do for a living
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
47099 Posts

Posted - 08/10/2012 :  09:59:08  Show Profile  Reply with Quote
also the paths specified are server paths so if your file is in remote path make sure you specify it in UNC format

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

mayaaa
Starting Member

15 Posts

Posted - 08/10/2012 :  11:46:30  Show Profile  Reply with Quote
Thank you!
I've used BULK INSERT and it worked :)
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000