Developer forum

Forum » Integration » Error on move data from temp table to main temple on import

Error on move data from temp table to main temple on import

Marie Louise Veigert
Reply

Hi,

DW version 9.19.5,

DW provider version:

Dynamicweb.DataIntegration.Providers.DynamicwebProvider.dll 4.0.4
Dynamicweb.DataIntegration.Providers.DynamicwebProvider, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
Build dato ma, 27 jan 2025 10:41

I get this error on an import.
I cannot figure out what the issue are. Anyone who have an idea to solve this?

Main error:
Error: failed to move data from temporary table [dbo.EcomShopGroupRelationTempTableForBulkImport2] to main table [dbo.EcomShopGroupRelation]. Exception: ExecuteNonQuery: CommandText property has not been initialized Sql query:  

 

Full error:

Error: failed to move data from temporary table [dbo.EcomShopGroupRelationTempTableForBulkImport2] to main table [dbo.EcomShopGroupRelation]. Exception: ExecuteNonQuery: CommandText property has not been initialized Sql query:  Stack:    at Dynamicweb.DataIntegration.Providers.SqlProvider.SqlDestinationWriter.MoveDataToMainTable(SqlTransaction sqlTransaction, Boolean updateOnly, Boolean insertOnly)    at Dynamicweb.DataIntegration.Providers.DynamicwebProvider.DynamicwebProvider.RunJob(Job job). System.Exception: failed to move data from temporary table [dbo.EcomShopGroupRelationTempTableForBulkImport2] to main table [dbo.EcomShopGroupRelation]. Exception: ExecuteNonQuery: CommandText property has not been initialized Sql query:  ---> System.InvalidOperationException: ExecuteNonQuery: CommandText property has not been initialized    at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async)    at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)    at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()    at Dynamicweb.DataIntegration.Providers.SqlProvider.SqlDestinationWriter.MoveDataToMainTable(SqlTransaction sqlTransaction, Boolean updateOnly, Boolean insertOnly)    --- End of inner exception stack trace ---    at Dynamicweb.DataIntegration.Providers.SqlProvider.SqlDestinationWriter.MoveDataToMainTable(SqlTransaction sqlTransaction, Boolean updateOnly, Boolean insertOnly)    at Dynamicweb.DataIntegration.Providers.DynamicwebProvider.DynamicwebProvider.RunJob(Job job)
2025-09-30 00:35:29.740: Import job failed: failed to move data from temporary table [dbo.EcomShopGroupRelationTempTableForBulkImport2] to main table [dbo.EcomShopGroupRelation]. Exception: ExecuteNonQuery: CommandText property has not been initialized Sql query: 

 

BR
Marie Louise

 


Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Marie,
it looks like you don't have any active column mappings for the EcomShopGroupRelation destination table. Try to check the table mappings and column mappings and set the appropriate columns as a key columns (ShopGroupShopID and ShopGroupGroupID).
BR, Dmitrij

 
Marie Louise Veigert
Reply

Hi,

Its set and have worked before:

 

 

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Marie,
Can you check if the option "Update only existing records" is not checked in the provider settings or in the table level settings:

Have you also update the SQL provider to the latest version 4.0.3?
BR, Dmitrij

 
Marie Louise Veigert
Reply

Nothing checkerd and I have the SQL provider at version 4.0.3. 

The solution is hosted at DW Cloud if I should send the issue through care.

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Marie,
I can not get it reproduced, it works fine for me without the mentioned options checked.
Could you check your destination provider settings to be sure that this option is not selected?


and also check if the table-level option I mentioned in the previous reply is also not checked?
BR, Dmitrij

 
Marie Louise Veigert
Reply

It got the job to run on our test. But its an update job, so isn't it an issue to remove 'Update only existing rows' ?

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply
This post has been marked as an answer

Hi Marie,
for this table and just 2 column in the mappings in it: EcomShopGroupRelation
both columns ShopGroupShopID and ShopGroupGroupID are Primary Key columns so there is no sense to update operation, only insert.
The key combination of ShopGroupShopID and ShopGroupGroupID is always a unique. If you would have any other 3 rd column in the mapping which is not a PK column then it make sense to run the update query.
BR, Dmitrij

 

Votes for this answer: 1
 
Marie Louise Veigert
Reply

I removed the 'ShopGroupShopID and ShopGroupGroupID' from my update job, so they are only in the insert job.

The other mappings are in my update job only. It solved the issue.

 

You must be logged in to post in the forum