0

Hello,

I'm using SQLBulkCopy to import data from a text file. There is a lot of data involved and I would really rather not import it row by row. There seems to be a problem with fields containing both numbers and text. (for example, a phone number '555-1212'). All fields that are mixed (numeric / text) are imported as null. Is there anyway to get this working?

I have no control over the format of the text file, as it is an export of data from a vendor application.

Thanks,
Rachel

2
Contributors
2
Replies
4
Views
6 Years
Discussion Span
Last Post by rairai979
0

Hi Rachel, you may get better answers from the MS SQL forum - http://www.daniweb.com/forums/forum127.html

But here's a hunch anyway: Might there be a problem mapping fields from source to destination? Are you sure the destination phone field is expecting text?

myBulkCopy.ColumnMappings.Add(blaah blaah)

0

Thanks, but yes, I'm sure the mappings are correct. I even changed the columns to text from varchar, expecting them to work. There aren't that many rows of data, but there are 153 columns (terrible, I know, but not my doing), and changing methods now would be time consuming for that reason.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.