Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot update a value in a table using UPDATE QUERY #86

Closed
NivedhaL20 opened this issue Mar 11, 2019 · 4 comments
Closed

Cannot update a value in a table using UPDATE QUERY #86

NivedhaL20 opened this issue Mar 11, 2019 · 4 comments

Comments

@NivedhaL20
Copy link

NivedhaL20 commented Mar 11, 2019

Am using Copy Activity where I want to update a value after the complete process gets over. So, in order to update a value, am using an UPDATE query. Actually it updates the value in a table but it fails the activity with the following ERROR :
"errorCode": "2200",
"message": "Failure happened on 'Source' side. ErrorCode=UserErrorInvalidDbQueryString,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException, Message=The specified SQL Query is not valid. It could be caused by that the query doesn't return any data. Invalid query: 'UPDATE tablename SET column1 = getdate() WHERE column2 = ' ' and column3= ' '.Source=Microsoft.DataTransfer.ClientLibrary,'",
"failureType": "UserError",
"target": "Copy Data 1"
Is it possible to update a query with a success status in COPY ACTIVITY ??

@NivedhaL20
Copy link
Author

It is better to use Stored Procedure for Upsert (Update and Insert) activities.

@RaghuVarmaS
Copy link

you can also use lookup activity for this. you just write sequence of queries in it. But in the last statement you can keep select 1 as x;

@Rohitkulkarni77
Copy link

Am using Copy Activity where I want to update a value after the complete process gets over. So, in order to update a value, am using an UPDATE query. Actually it updates the value in a table but it fails the activity with the following ERROR :
"errorCode": "2200",
"message": "Failure happened on 'Source' side. ErrorCode=UserErrorInvalidDbQueryString,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException, Message=The specified SQL Query is not valid. It could be caused by that the query doesn't return any data. Invalid query: 'UPDATE tablename SET column1 = getdate() WHERE column2 = ' ' and column3= ' '.Source=Microsoft.DataTransfer.ClientLibrary,'",
"failureType": "UserError",
"target": "Copy Data 1"
Is it possible to update a query with a success status in COPY ACTIVITY ??

Are you using the SQL POOL DATABASE.

@fhljys
Copy link
Member

fhljys commented Mar 7, 2021

Chain a stored procedure activity after copy activity to update value should be the recommended way.

@fhljys fhljys closed this as completed Mar 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants