Salton
Salton

Reputation: 199

Data import from CSV to SQL Azure Database

I am trying to load CSV file to Azure Database using SQL Server Import and Export Wizard. I am getting the following error message at "Copying to "dbo".mytest_table"...

Error 0xc0047022: Data Flow Task 1: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "Destination - mytest_table" (38) failed with error code 0xC020844B while processing input "Destination Input" (41). 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)

Upvotes: 1

Views: 3263

Answers (2)

Lee Cordell
Lee Cordell

Reputation: 276

For anyone that comes across this in the future: if you're just importing a sheet from excel that doesn't have a primary key, do the following:

Click the 'Edit Mappings' button at the 'Select Source Tables & Views' step. Click 'Edit SQL' and add the following at the end of the SQL statement before the closing bracket to add a calculated id field: , ID INT IDENTITY(1,1) PRIMARY KEY CLUSTERED

Upvotes: 1

crthompson
crthompson

Reputation: 15865

As you are setting up the mapping, do you create an primary key for new mytest_table? Also, look at the CSV properties, I believe there is a way to indicate the primary key column.

Upvotes: 1

Related Questions