Another possible issue at play might be that you can't use dynamic table or column names by default - see this post: How do I write a SQL UPDATE with dynamic columns
Another possible issue at play might be that you can't use dynamic table or column names by default - see this post: How do I write a SQL UPDATE with dynamic columns