Today I received a seemingly simple task — to modify a piece of data in a database. Sounds simple enough.
A search on the Internet soon pieced together the corresponding SQL statement:
UPDATE [suivi].[dbo].[numSerie]
SET ni_numCible = ‘HF17263N7P13340’
WHERE ni_num = ‘HF17262A1400234’
As you can see from the above statement, the task is simple. In the [suivi].[dbo].[numSerie] table, find the record ni_num = ‘HF17262A1400234’ and set the ni_numCible field for that record to ‘HF17263N7P13340’.
Unexpectedly, after the above statement is executed, the following prompt appears:
Msg 18054, Level 16, State 1, Procedure tg_InsUpdCible, Line 31
Error 50010, severity 16, state 1 was raised, but no message with that error number was found in sys.messages. If error is larger than 50000, make sure the user-defined message is added using sp_addmessage.
Msg 3609, Level 16, State 1, Line 1
The transaction ended in the trigger. The batch has been aborted.
After the execution should not appear “XX Rows Afftectd”, as SQL small white, for this pile of prompts, it means that I do not understand.
Well, Google it, OK, and see the first result.
It looks like I got the same error message, so take a closer look. The following code is found:
/*Check for valid parameter*/
If LEN(@txtbidderid) =0 or ISNULL(@txtbidderid, ") = "
RAISERROR(50002,10, 1,'Error Accessing Bidder Record - Must Provide Bidder ID')
ELSE
The Error 50002 obtained by the author should be output here, then my next work should be to find where the file I output Error 50010 here is, after finding out, why should I throw Error 50010 to me, how to avoid it will be easily solved!
I don’t know what kind of file the author posted. After searching for a few key words in this file, I get trigger. This means that the insert \ UPDATE \ DELETE operation will automatically trigger some operations. But where’s this trigger?Let’s find out.
Check the contents of the highlighted file in the figure above, and sure enough, it says under what conditions Error 50002 will be thrown.
Right-click the file and, alas, there isa Disable menu that appears to Disable the trigger.
After disabling the trigger, go back to the original SQL statement in this article and you’re done! And then the trigger is enabled. OK, mission accomplished!
For those of you who know a little bit about SQL, this little problem today should be very easy to solve. But for someone like me who knows very little about SQL, it can be a real threat. Record the process of solving the problem now, is to provide the solution to the rest of the same problems, more important is to remind yourself, have a problem, the key is to solve the problem, don’t encounter a problem, find a pile of related tutorials to begin again chew, this can’t be sure, there is no doubt that this will give up less than half an hour. Always take the solution of the current problem as the fundamental goal, step by step, the problem will be solved naturally.
Reproduced in: https://www.cnblogs.com/outs/p/7730733.html
Read More:
- SQL Server calls Database Mail to send mail error: Msg 229, Level 14, State 5, Procedure sp_send_dbmail, Line 1 EXECUTE
- Spring data JAP SQL error:17059 SQL State:99999
- SQL state [null]; error code [0]; Error; nested exception is java.sql.SQLException: Error] with root
- A case diagnosis and solution of DB2 error code 1639 and SQL state 08001 is described in detail
- Error code 1045, state 28000, Java sql.SQLException :Access denied for user ‘root’@’localhost’
- ERROR processing query/statement. Error Code: 0, SQL state: TStatus(statusCode:ERROR_STATUS sqlState
- errorCode: 500, msg: , result: {“Message”:”There was an error processing the request
- Error attempting to get column ‘failure_msg‘ from result set
- Resolve the error raise importerror, str (MSG) + ‘, please install the python TK package’ (valid for personal testing)
- Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the
- Change API level Android studio
- SAP SQL error “SQL code: -10692“ occurred while accessing table “ZTXXXX“.
- Cannot call the same level library solution in pychar
- PHP CI (CodeIgniter) log level setting
- DB2 SQL ERROR: SQLCODE=-803, SQLSTATE=23505, SQL
- This function has none of deterministic, no SQL, or reads SQL data in its error records
- Eclipse Syntax error, annotations are only available if source level is 1.5 or greater
- Error (12153): Can‘t elaborate top-level user hierarchy
- Python error prompt unindent does not match any outer indentation level
- raise HTTPError(req.full_url, code, msg, hdrs, fp)urllib.error.HTTPError: HTTP Error 404: Not Found