Wednesday, January 26, 2005

Bulk Insert and Hex Codes

I've been working with an airline to redesign their reservation data mart. All has been going well until tonight's data extract from their reservation vendor - all of the bulk insert sprocs failed. The error pointed to data length problem, so my first thought was that the data format had changed without warning. It turns out that the row termination character had changed and bulk insert wasn't seeing the end of the last column. But the new terminator wasn't obvious. In notepad, the text data looked normal. After Googling to find a good hex editor (it's been a while since I got to use a hex editor for data detective work),and downloading XVI32 hex editor, I discovered that the new row terminator was hex 0x0A. Setting bulk insert's terminator value to the hex value worked wonderfully.

0 Comments:

Post a Comment

<< Home