Hey,
Can you please suggest which database are you executing the script ? (Azure SQL DB, SQL MI etc)?
Also is that the complete logic within the script task?
Below should be the sample aspect :
update MyDB.dbo.MyTable
set column1 = @{variables('MyDynamicVariable')}
And can you provide a screenshot of the input window of script task after execution :
And copy the text and try executing the script as is on database via SSMS as a debugging purpose as well