Hello, I'm trying to import data from the excel file to a table (with previous data) in SQL Server, this table has an identity column, so I'm getting problem with this column when I'm trying to import the data from the excel file. In DTS I configure do "Append
rows to destination table" and "Enable Identity Insert" (I've tried with this unchecked but did not work) so I get this script example script: Function Main() DTSDestination("CNPJ") = DTSSource("CNPJ") DTSDestination("RAZ") = DTSSource("RAZ") DTSDestination("END")
= DTSSource("END") DTSDestination("CEP") = DTSSource("CEP") Main = DTSTransformStat_OK End Function In the above script, the identity column is not mentioned automatically. So I get this error: Error at Destination for Row number 1. Errors encountered so far
in this task: 1 Insert error, column 1 ('cod', DBTYPE_14), status 10: Integrity violation, attempt to insert NULL data or data which violates constraints. But I cannot disable the Identity column of this table, cause I cannot lose the previous identity from
the other rows in the table (because I have other tables related with this through this identity column). Does Anyone know how to fix that? Thanks Marco
Marco Antoni...
Member
5 Points
1 Post
Importing data with DTS (identitiy column)
Oct 05, 2003 03:34 PM|LINK