Partager via


SQL services failing to start

Here is a weird scenario which my client faced where the SQL services failed to start. Tried to start it from SQL server configuration manager and services but the request timed out. Later tried using the command prompt (admin privilege) by entering the executable path and here is the exception that was thrown,

Tried to check the error logs, but there were no logs generated and the application and system event logs were also not that evident. Thus tried to trace the DLLs being called during the SQL startup and thus used the Dependency Walker tool which is available for public download at  www.dependencywalker.com.

Downloaded the tool, launched the application 'Depends.exe' and selected 'start profiling' option from the standard tool bar. The below dialogue box appears and the fields are provided with the values as shown and click on OK.

Post which we re-produced the issue and the trace was captured with the error as shown :

LoadLibraryW("D:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn\SQLBOOT.DLL") called from "SQLSERVR.EXE" at address 0x000000000151CDE4.
LoadLibraryW("D:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn\SQLBOOT.DLL") returned NULL. Error: The specified module could not be found (126).
LoadLibraryA("USER32.dll") called from "SQLSERVR.EXE" at address 0x00000000018B2347.
LoadLibraryA("USER32.dll") returned 0x0000000076CC0000.

It was clear that SQLBOOT.DLL was missing and thus we placed it at the required location and tried to start SQL using the command prompt. Though SQL started it immediately failed with the following error in the error logs :

2017-09-08 15:24:44.79 spid7s Error: 918, Severity: 21, State: 1.
2017-09-08 15:24:44.79 spid7s Failed to load the engine script metadata from script DLL 'SQLSCRIPTUPGRADE.DLL'. The error code reported by Windows was 126. This is a serious error condition, which usually indicates a corrupt or incomplete installation. Repairing the SQL Server instance may help resolve this error.

Thus ran the dependency walker again to verify the missing DLL and even the trace proved recorded that SQLSCRIPTUPGRADE.DLL was missing.

LoadLibraryW("D:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn\SQLSCRIPTUPGRADE.DLL") called from "SQLSERVR.EXE" at address 0x0000000000B3CDE4.
LoadLibraryW("D:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn\SQLSCRIPTUPGRADE.DLL") returned NULL. Error: The specified module could not be found (126).
Exited "SQLSERVR.EXE" (process 0xD50) with code -1 (0xFFFFFFFF).

On placing the missing DLL back the issue was resolved. SQL server and SQL agent services were up and running seamlessly.

Hope this helps!! Happy resolving!!