Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using BCP to copy data from ASCII file to MS SQL 2000

Status
Not open for further replies.

vt100

Programmer
Joined
Oct 21, 2001
Messages
2
Location
US
Hi! I need to get data from ASCII file with tab separated fields into MS SQL server 2000. The destination table in sql server has more fields than the ascii file so I've tried using the format file to map out the fields i want copied from flat file to database but I get an error "Invalid column number in format file 'test.fmt'
It doesn't tell me any specifics so I can't really figure out where the problem is! Any help will be appreciated!
 
I'd try to BCP into a tmp table with the correct amount of fields, once the data is on some sort of table it should be easy to manipulate.

cheers
D
 

Read the topic, "Using a Data File with Fewer Fields," in SQL Books Online. It explains how to set up the format file in this case. Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top