I am looking for few global variable in mysql which are equivalent of sql server.
I want the whole list
eg.
Sql Server Equivalent
@@error —
@@Identity —
etc.
Basically right now I want to know what are the equivalent variable of @@error and @@identity.
But it will be helpfull if u could provide some other variable also
The last
auto_incrementvalue (i.e. the last identity) generated for the current connection can be found using theLAST_INSERT_ID()function.About errors, not sure ; there doesn’t seem to be any system variable that corresponds to the last error message.
There is a
show errorsstatement :But not sure how you can use this result…
After searching a bit more, I found out this thread : Getting the last error message, which says (quoting) :
And the first answer states (quoting) :