Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
jwood
Starting Member
1 Post |
Posted - 2009-03-18 : 12:38:28
|
Dear Forum,First of all, I would like to thank you for looking at my issue.I am trying to import an excel file into a table in sql server 2000The problem is, my Id column in the database does not allow nulls and It is not auto filling.The columns in my excel file are: Pw, Sent, DownloadedThe Columns in my db table are: Id, Pw, Sent, downloadedI am hoping to get the Id column in my table to autofill from 2 to 5000 as these rows are added. But it is giving me the error: Error at Destination for Row number 199. Errors encountered so far in this task:1. The statement has been terminated. Cannot insert the value NULL into column 'Id', table 'simplestereo.dbo.songdload1';column does not allow nulls. INSERT fails.I am using the DTS Import Export Data Wizard. When I click on the "Transform" button, and go to the "Column Mappings and Transformations" screen, it says that my Id column has no source and should be Ignored. What I would like to do is have that autofill the number incrimentally in the Id column in the database.See Screenshot: http://www.iconconcerts.com/misc/columnmappings.jpgAdding an Id column in my excel document with numbers 2 though 5000 would not work well because what if I want to import more rows later? It would be weird to make the second excel spreadsheet I import have an Id column that starts at 5001 and ends at 10,000. So my question is, how do I make the database Id colum autonumber as it imports these in? Similar to how it autonumbers when I just do a simple Insert into the database.Here is a screenshot of my table design: http://www.iconconcerts.com/misc/columndesign.jpgI appreciate your help, or any advice you have.ThanksJeffBoise, ID |
|
sakets_2000
Master Smack Fu Yak Hacker
1472 Posts |
Posted - 2009-03-26 : 13:49:23
|
Your ID column is an identity column. So just uncheck enable identity insert in column mapping and transformation screen and you should be fine. To have ID column fill up from 2, you'll need to change the identity seed to 2 in table design screen. |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|
|