Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Importing data from text file using BCP

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-12-05 : 07:27:26
lavanya writes "I tried a code to import data from a text file using the BCP utility.

I created a textfile states.txt C:\StateList\States
and craeted a table called "States" in a database
I tried to import the textfile data into states by typing the foll in Cmd window
bcp customers.sales.states in states.txt -f states.fmt -T

Got an error
Microsoft SQLClient unable to open the host data-file.

Please tell me how to do this properly."

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-12-05 : 07:49:29
Specify complete path to the text file. Also, if .fmt file not in same directory as BCP, specify complete path there also.

Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page
   

- Advertisement -