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 |
dmccalla
Starting Member
3 Posts |
Posted - 2006-05-19 : 10:23:01
|
I am trying to import a single column of data I get via a SQL query into a table with 5 columns. The data I am trying to import is just text (names of managers). Here is the target DB info:column data type length allow nullsid int 4 status nchar 1name nvarchar 255ordinal int 4is_default nchar 1id is the primary key and is set to autonumber. In SQL Enterprise Manager, I can type in a name and tab to the next line and all of the other field populate with their defualt values. The issue is when I import with a DTS package it errors out at line 93 (there are 93 mnaagers) saying it cannot insert the value NULL into the column id. I verified that there is no blank line at the end of the data I am trying to insert. Anyone have any ideas? I am a little green behind the ears with DTS so aplogies if I am missing anything obvious. TIA! |
|
elancaster
A very urgent SQL Yakette
1208 Posts |
Posted - 2006-05-19 : 10:33:13
|
i haven't got it here to open and check but from memory.... isn't there an option of 'allow inserts to id' or something in the dts? see if that's checked first. |
 |
|
dmccalla
Starting Member
3 Posts |
Posted - 2006-05-19 : 10:37:00
|
Allow identity insert is what I think you mean and I have that checked. |
 |
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2006-05-19 : 11:35:08
|
The data you are trying to insert is text so you want the server to set the identity value.You need to uncheck the alloww identity insert as that would expect the identity value from the source.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
dmccalla
Starting Member
3 Posts |
Posted - 2006-05-19 : 12:30:07
|
The requirements for this ended up changing so I ended up not requiring the id field to be the primary key and allowed it to be null. The original intent of this field was to store the names of the supervisors and assoc. that with another table that stored all of the information for contacts. Now we just populate a dropdown based on the names in this table. No need for id's, etc. Thank you all for your prompt feedback. |
 |
|
|
|
|