question

blcady avatar image
blcady asked

import csv with wizard into SQL server get id's auto populated

I am import wizard to import csv to sql server table My existing empty table has id colum, int, notnull and is idenity, 1,1 primary key is ingredientname char (20) In my .csv I only have one column for the ingredient name. I do map it, I am expecting the ID to auto popululate but I get an error that nulls are not allowed. in the wizard when I have identity on. Can you help?
import-datacsvidentity
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
SirSQL avatar image
SirSQL answered
Do you mean that in the wizard you have identity insert on? If that's the case you'll need to uncheck that setting as you aren't performing an identity insert (that's used for cases when you want to manually insert a value into the column which has an identity associated with it).
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.