This is a discussion on Problems importing data into sql server within the SQL Server forums, part of the Microsoft SQL Server category; --> I have a table for authors (for our bookstore) that has several fields (firstname, lastname, etc.) and an author_id ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I have a table for authors (for our bookstore) that has several fields (firstname, lastname, etc.) and an author_id field (set as identity) I'm trying to import a spreadsheet into this table, but keep getting error messages that say I can't import data into the author_id field (the identityf field). Can someone suggest what I can do to overcome this? Thanks, Bill |
| |||
| 1) Import the data into a new flat table (ie: without indexes). 2) Run a report on the key field (identityf) -- there must be no duplicates. select indentityf, count(*) from newtable group by identityf having count(*)>1 should yield no results. 3) Correct the spreadsheet. 4) reimport the spreadsheet. "Bill" <billzimmerman@gospellight.com> wrote in message news:8da5f4f4.0312091329.c066e47@posting.google.co m... > I have a table for authors (for our bookstore) that has several fields > (firstname, lastname, etc.) and an author_id field (set as identity) > > I'm trying to import a spreadsheet into this table, but keep getting > error messages that say I can't import data into the author_id field > (the identityf field). > > Can someone suggest what I can do to overcome this? > > Thanks, > > Bill |
| ||||
| "Bill" <billzimmerman@gospellight.com> wrote in message news:8da5f4f4.0312091329.c066e47@posting.google.co m... > I have a table for authors (for our bookstore) that has several fields > (firstname, lastname, etc.) and an author_id field (set as identity) > > I'm trying to import a spreadsheet into this table, but keep getting > error messages that say I can't import data into the author_id field > (the identityf field). > > Can someone suggest what I can do to overcome this? <snip> Use the DTS. On the screen that allows you to select the tables, click the Transform button. On this screem, you'll see 'Allow Identity Insert'. BV www.iheartmypond.com |