0

When SQL Server throws permissions errors (or other OS errors), it generally logs something of the form "Cannot open file {blah}. Operating system error 3 (failed to retrieve text for this message)".

It's a simple one: what is it that's stopping SQL Server retrieving the error text? I'm assuming it's a permissions problem somewhere, but I don't know what mechanism SQL uses to translate OS error codes to actual text messages to actual get this working in the first place.

NOTE: I'm not asking "how do I fix the initial error" (just incase someone misreads the question) -- this is "how do I get SQL Server to sucessfully translate the OS error number to text so I don't have to keep looking up or remembering what the OS error numbers mean".

This is one of those that there probably is an answer out there, but it's drowned out by all the questions asking "what does OS error mean", and I can't find the right google incantation...

Chris J
  • 1,218
  • 18
  • 32
  • 1
    I don't know what stops MSSQl from retrieveing the error message but, ultimately, it should be calling the OS API FormatMessage. It's possible that a mismatch between the OS language and the SQL server language could cause that. Edit: Also, you can get the error string from the command-line by running "net helpmsg 3" – Stephane Nov 16 '11 at 15:24
  • Ah ... didn't know about `net helpmsg`. Ta :-) – Chris J Nov 17 '11 at 09:28

1 Answers1

0

There are few reasons why the FormatMessage fails: out-of-memory conditions, a locale issue or a corrupt OS instalation. An OOM would not cause this to happen always, the error message would display properly sometimes. A locale mismatch would show this problem consistently, and so would a corrupted OS installation. Given that your SQL error is in what looks like US English, I assume your SQL installation is US English. What language is your OS installation? Does the folder %SystemRoot%\System32\en-US exist? How about %SystemRoot%\SysWOW64\en-US, and is the SQL instance a 32 bit installation?

Remus Rusanu
  • 8,283
  • 1
  • 21
  • 23
  • 32-bit install on a 32-bit box (Windows 7 -- my dev PC). Although I see it on our dev servers as well (64-bit Win 2k8 running 64-bit SQL 2k8). OS is set up for UK locale (I'm right-pondian, sorry :-) ), however I have `en` and `en-US` in System32. I have no SysWOW64 folder. However that its using `FormatMessage` at least gives me something to work with. – Chris J Nov 17 '11 at 09:29