When appending a table using Import Wizard in SSMS, how can I have the ID auto increment?

23 views Asked by At

I'm using the Import Wizard to import data from an Excel file into an existing table.

Currently, I have to take the largest ID from the spreadsheet, copy it, refresh the sheet, paste that value + 1 into the first empty cell in the ID column, + 1 in the next row, then auto fill it all the way down the sheet.

Then I save it and use the import wizard in SSMS to import that data into the table.

When I looked up how to have auto increment, it said to hit "edit SQL" after selecting "Edit Mappings" but that option is greyed out for me since I'm appending I'm assuming.

I haven't been able to find a way that allows auto increment, which would drastically cut down the time it takes to do all this. I can't copy/paste because the file has too many rows and causes the server to crash.

Edit SQL greyed out

I tried leaving the ID column blank and selected "enable identity insert" and that would work, but I just got an error that the action couldn't be executed.

0

There are 0 answers