3

I know this question might be repeated. But what I get issue with this is different. I have already created table "CRM_Doctor_Budget" with no data.

Table Created in sql server 2008

I want to insert data in this table from excel file.

I am using import and export data (32-bit).

Following step I do:

First step

Second step

third step

5th step

6th step

7th Step

8th step

Error which I am getting :

- Validating (Error)
Messages
Error 0xc0202049: Data Flow Task 1: Failure inserting into the read-only column "Id".
 (SQL Server Import and Export Wizard)

Error 0xc0202045: Data Flow Task 1: Column metadata validation failed.
 (SQL Server Import and Export Wizard)

Error 0xc004706b: Data Flow Task 1: "component "Destination - CRM_Doctor_Budget" (59)" failed validation and returned validation status "VS_ISBROKEN".
 (SQL Server Import and Export Wizard)

Error 0xc004700c: Data Flow Task 1: One or more component failed validation.
 (SQL Server Import and Export Wizard)

Error 0xc0024107: Data Flow Task 1: There were errors during task validation.
 (SQL Server Import and Export Wizard)

I am getting error in converting varchar,int,smallint,bit data type. Because excel file has general datatype for all data. And In my already created table I have varchar, int, float, smallint and bit.

After checked "Enable Identity Insert" I get less error but errors are as follow :

Copying to [dbo].[CRM_Doctor_Budget] (Error)
Messages
Error 0xc0202009: Data Flow Task 1: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 10.0"  Hresult: 0x80004005  Description: "Unspecified error".
 (SQL Server Import and Export Wizard)

Error 0xc020901c: Data Flow Task 1: There was an error with input column "Id" (143) on input "Destination Input" (72). The column status returned was: "The value violated the integrity constraints for the column.".
 (SQL Server Import and Export Wizard)

Error 0xc0209029: Data Flow Task 1: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The "input "Destination Input" (72)" failed because error code 0xC020907D occurred, and the error row disposition on "input "Destination Input" (72)" specifies failure on error. An error occurred on the specified object of the specified component.  There may be error messages posted before this with more information about the failure.
 (SQL Server Import and Export Wizard)

Error 0xc0047022: Data Flow Task 1: SSIS Error Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput method on component "Destination - CRM_Doctor_Budget" (59) failed with error code 0xC0209029 while processing input "Destination Input" (72). The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.  There may be error messages posted before this with more information about the failure.
 (SQL Server Import and Export Wizard)
1
  • have you tried to save as csv file and then bulk insert with tsql? The syntax is pretty easy. bulk insert [table_name] from [filepath.csv] with (rowterminator='\n', fieldterminator=',') you just need to chop the column headers out of the csv file. Commented Mar 6, 2013 at 15:46

2 Answers 2

2

I have solved the problem. I had made some changes like:

In Edit Mapping : As I have ID as an identity column and it is auto generated column.

As previously I have mapped Id column.

Now This time I did not map ID column and make unchecked the "Enable I identity Insert"

Else I perform step as it is .. this minor change I have done and I get records import successfully. :) thank you all for helping.

Sign up to request clarification or add additional context in comments.

Comments

1

Is the ID column an identity column? Because if it is, you need to click the "Enable Identity Insert" checkbox to get this to work.

2 Comments

I have tried your suggestion yes My ID column is an identity column. So I tried with "Enable Identity Insert" it works better than previous one. thanks for that.
@anshu - Ok, so the next error you are getting with the I'd column is about it violating integrity constraints. Is the Id column also a primary key and do you have duplicates inside the CSV in this column? Or are there some formatting errors with the CSV that mean you're trying to import text data into the Id column etc?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.