How to Convert Hex Windows Error Codes to the Meaningful Error Message – 0x80040002 and 0x80040005 and others? – Interview Question of the Week #182

Question: How to Convert Hex Windows Error Codes to the Meaningful Error Message – 0x80040002 and 0x80040005 and others?

Answer: This blog is not specific to SQL Server, but I have recently seen hex error codes in SQL Server ERRORLOG and it took me little time to get the meaning of it. In this blog, we would learn about how to convert a hex windows error codes to meaningful error messages.

Here are the few sample error codes which can be seen in Windows:

0x80040002
0x80040003
0x80040005
0x80070005
0x80040005
0x80070490
0x8007054f
0x80070bc2
0x80070070
0x80070643

It would be humanly impossible to remember the meaning of all the codes. Here are the simple steps to get an error message. Let’s pick 0x80070070 as an example.

  • Make note of the last four numbers of the code – 0070 from the example.
  • Convert the hex number to decimal number using a calculator.
    How to Convert Hex Windows Error Codes to the Meaningful Error Message - 0x80040002 and 0x80040005 and others? - Interview Question of the Week #182 hex-2-msg-01

So, Hex 70 = Dec 112.

  • Use command prompt and use the command “NET HELPMSG ” followed by the decimal number. 112 in our example.
    How to Convert Hex Windows Error Codes to the Meaningful Error Message - 0x80040002 and 0x80040005 and others? - Interview Question of the Week #182 hex-2-msg-02

The output of the command is “There is not enough space on the disk.”

Here are some most common hex codes and their meaning, just to save some time for you.

0x80040002The system cannot find the file specified.
0x80040003The system cannot find the path specified.
0x80040005Access is denied.
0x80070005Access is denied.
0x80040005Not enough memory resources are available to process this command.
0x80070490Element not found.
0x8007054fAn internal error occurred.
0x80070bc2The requested operation is successful. Changes will not be effective until the system is rebooted.
0x80070070There is not enough space on the disk.
0x80070643Fatal error during installation.

Hope you would find this blog useful to learn the trick to covert the hex code to a meaningful message.

Reference: Pinal Dave (http://blog.SQLAuthority.com)

SQL Error Messages, SQL Server, SQL Server Security
Previous Post
How to Generate Random Password in SQL Server? – Interview Question of the Week #181
Next Post
How Old Version of SQL Server Running on Server? – Interview Question of the Week #183

Related Posts

Leave a Reply