Strange SQL Update Issue

I am trying to run a simple update statement on a database.  Here is the update:

UPDATE dbo.TkprBudget
SET tkprbudget.TBBudHrsWrk = '2'
WHERE tbemp = '130' and tbprdyear = '2015' and TBPrdNbr = '1'

When I run it I get these errors:

Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '+'.
Msg 208, Level 16, State 0, Line 1
Invalid object name '##XML'.

I have no clue what this is talking about.  There is no + sign and I dont know what object ##XML is referring to either.  Am I missing something obvious here?  This is SQL 2012.  Thank you for your help.
mattpayne59Asked:
Who is Participating?
 
Scott PletcherConnect With a Mentor Senior DBACommented:
Run this command from within the db:

EXEC sp_helptrigger 'dbo.TkprBudget'
0
 
PortletPaulfreelancerCommented:
What is the relevance of Access to this question?

How are you running the update query?
0
 
mattpayne59Author Commented:
Sorry... Not sure how access got in there as a topic.  This is straight sql.

I am just running the query in the query window in SQL management studio.
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
PortletPaulfreelancerCommented:
Running [ only & just the displayed query ] in the query window in SQL management studio

I have no idea, sorry.
0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
Check if in that query window exists more code. If so, select only the statement that you want to run and press F5 or Execute button.
0
 
mattpayne59Author Commented:
It only has that code. I commented out the rest. I also connected using a 2008 management studio and copied that code in only to the query and I got the same issue. It is very strange.
0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
Then check if the TkprBudget has any update trigger.
0
 
Nakul VachhrajaniConnect With a Mentor Technical Architect, Capgemini IndiaCommented:
Get a Profiler trace with statement level details, and investigate if any cascading triggers and/or stored procedures are being executed as a result of this UPDATE statement. Chances are that some of that logic is using a temporary table with the name - ##XML and has overloads on the + sign (or is attempting to concatenate 2 strings) - which is where the failure is.
0
 
mattpayne59Author Commented:
I see the statement being executed in Profiler but I dont see anything else executing around it.  No stored procedures or triggers.
0
 
Vitor MontalvãoConnect With a Mentor MSSQL Senior EngineerCommented:
Isn't that easy to see it in the Profiler. Use SSMS and check for the existence of triggers in the table.
0
 
mattpayne59Author Commented:
Definitely some triggers... I dont think this is going to be possible with a simple update query then.  I will go another route.  Thank you for the help everyone.
0
 
Scott PletcherSenior DBACommented:
You can always code a "bypass" in the trigger(s), to have it(them) exit without doing anything when you explicitly tell the trigger not to.  CONTEXT_INFO is the easiest way to do that.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.