August 9, 2012 at 10:22 am
Hey guys,
Just wondering why this was not working...I have already did a workaround but I wanted to revisit this b/c I was surprised it was not working...
I had an Excel spreadsheet that had 3 columns...
Wanted to import this into a table that had the same 3 columns with an extra column as an ID field that was set to IDENTITY auto increment by 1...
I went through the Import/Export wizard and when I edited mappings, I checked Enable Identity Insert...I have done this a million times and I dont think I have ever run into this but what was happening is when I clicked Finish, I would get the error of Cannot insert value NULL into ID field, column does not allow NULLS...
Well of course it would be NULL coming in, b/c its an identity column...Its supposed to auto populate that field! And I checked that box Enable Identity Insert...
Why did it give me this error?
August 9, 2012 at 10:28 am
Don't check "Enable Identity Insert". You would only want that if you actually had the ID column with values in the data you're trying to import. With that off, it should work and assign the IDs automagically.
August 9, 2012 at 10:44 am
I tried both ways checking and unchecking that box and it still failed on me...
August 9, 2012 at 11:49 am
Don't map the identity column to anything.
August 9, 2012 at 12:42 pm
I dont map it...
When going to Edit Mappings, I have ignore next ID
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply