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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing Text Data Into a Table

Status
Not open for further replies.

DBADoug

Programmer
Oct 25, 2000
27
US
I have a table schema as follows:

field1 datetime
field2 float
field3 varchar(50)

I am attempting to import a text file, with records in the following layout. Here's a sample record:

11/16/2003 12:10a 146,944 log_dump.11160010

I've tried using BULK INSERT, but each time, it tells me that 0 records were inserted. There are no syntax errors. I even created a format file from a bcp export that I tweaked to align up with the text file layout, but I get the same results.

Any help pointing me the right direction would be appreciated. Thank you.
 
First of all, can you use Enterprise Manager. If so, drill down to your table w/in the database. Right-click on the table and choose "All Tasks" then "Import Data" set your source as a text file and the point it to your file. The rest of the questions should be self-explainatory.

Is your file comma or tab delimited ... or delimited at all. Let us know how this works out for you!

Thanks

J. Kusch
 
J ... I'm writing this as part of a script, and therefore cannot use enterprise Manager, which makes it easy. The file is the output of a dos DIR command, piped to a text file, so I'm not sure how the delimited state is, but I don't think it is straight tab delimited.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top