Hello guys. I have a problem and I need your help.
I’m trying to update a certain value in SQL using a variable in the querry. The querry looks like this:
"UPDATE dbo.X_PREKES
Set PrekesStatusas = 'Užkelta į RRR'
Where KatalogoKodas = "+Kodas+""
And variable Kodas=CurrentRow.Item(“internal_notes”).ToString
Basically it reads X_PREKES table and updates the Column value of PrekesStatusas to “Užkelta į RRR”, where KatalogoKodas column value is the value from excel (For example it is ZSB111094LXX). But when I start it, i get an error:Run command: Invalid column name ‘ZSB111094LXX’
How to solve this?
Yeah have parameter declared with a different name and pass the variable as value to it using a assign activity
Put this assign activity before to your update query activity @Povilas_Jonikas
Ok, I have assign activity before the SQL update. Assing activity is Code=CurrentRow.Item("internal_notes").ToString
Then i have ExcecuteNonQuerry activity parameters with name=kodas, and value=Code but still got the same error:Run command: Must declare the scalar variable “@kodas”.