Given the error message "Incorrect syntax near the keyword 'SET'" , I would speculate that you have a SQL server error. Are you absolutely sure that your SQL statement is correct? You might want to drop a print statement in your code to have the SQL print out prior to the prepare so that you can see if it is being passed on correctly.
I will have to agree with the rest. I programmed SQL for about a year, and I never once used the SET command with INSERT.
It should be like this:
INSERT INTO myTable myColumn1, myColumn2, ...
I removed the SET and tried to change the INSERT statement to a standard INSERT statement. It doesn't work then either. The carp doesn't show me any errors. The script does operates the way it is supposed to but will not post to the table.