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 2005 Forums
 Transact-SQL (2005)
 bcp - import data into table from .txt file

Author  Topic 

amitkumarmadhukar
Starting Member

45 Posts

Posted - 2008-01-12 : 12:17:08
I used a bcp command in SQL Server 2005
the command is


bcp "[bms chennai].DBO.tblPrList" in "D:\Data.txt" -c -t\t, -r\n
-S<SERVER_Name> -Usa -P

My text file contain five field
each field is seperated by tab key and each row is terminated by enter key.

please send me the solution immediatly at govindykumar@yahoo.com

amit kumar madhukar

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-01-12 : 12:31:02
Didn't work? Any error?
Go to Top of Page

Jeff Moden
Aged Yak Warrior

652 Posts

Posted - 2008-01-12 : 18:23:32
Sending the solution to a private email would mean that no one else would benefit.

Rmiao is correct... what is your actual problem? The BCP command you have looks correct.

--Jeff Moden
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-01-14 : 02:27:39
quote:
Originally posted by amitkumarmadhukar

I used a bcp command in SQL Server 2005
the command is


bcp "[bms chennai].DBO.tblPrList" in "D:\Data.txt" -c -t\t, -r\n
-S<SERVER_Name> -Usa -P

My text file contain five field
each field is seperated by tab key and each row is terminated by enter key.

please send me the solution immediatly at govindykumar@yahoo.com

amit kumar madhukar


Make sure that the file exists in the SERVER's directory and not at the CLIENT's you are working with

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -