Bulk Insert Error: Converting int
Posted on 2005-05-09
Experts. This problem has my head spinning.
I have a text file and there are 4 columns, tab delimited.
37501 Quaneyah Cleveland NULL
50903 Nelson Urena-Perez NULL
127207 Darryl Muldrew 08
I'm trying to bulk insert this into a table with 4 columns.
CREATE TABLE [LoadStudentTable] (
[StudentID] [int] NOT NULL ,
[StudentFirstName] [varchar] (35) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[StudentLastName] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[StudentGrade] [varchar] (2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
When I run the bulk insert it inserts the table, but gives the following results.
808793907 Quaneyah Cleveland NU
809054261 Nelson Urena-Perez NU
842478129 Darryl Muldrew 08
If you notice StudentIds DO NOT match. Its performing some type of crazy conversion. I've checked the file using DTS and it works fine, but I HATE DTS and refuse to use it. :)
Thanks in advance!