SQL Connection Error – (provider: Named Pipes Provider, error: 40)

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server.

7bqXg

This is trying to tell you that some of the services are not running and it is not communicating with the database.

Basically go to SQL Server Configuration Manager either searching or going to All apps…

Under “SQL Server services“, check your services if they are started and running…

Capture45333

If necessary just start the services and try logging in..

 

 

Updates stuck at 5% on Server 2012 R2

A few of my friends had this issue and I had it recently. After updates applied using WSUS one of the VMs got stuck on 5% over a few hours. Tried a few things;

Go to the ‘Automatic Start action‘ on virtual machine settings to change the delay to 5 seconds, this way you can hold f8 to get to options, or shift+f10 to get the troubleshooting menu

4

and Choose Command Prompt

5
Run

dism.exe /image:C:\ /cleanup-image /revertpendingactions

make sure you change the drive X: to C but  I received error 3017.

Next thing to try is to go to c:\windows\winsxs

dir pending and locate pending.xml

and rename this file which has got all the pending update details.

ren pending.xml pending_old.xml

and create a blank pending.xml file

echo > pending.xml

Also rename softwaredistribution folder under C:\Windows

ren softwaredistribution softwaredistribution_old

This folder contains updates. Restarted and Voila! back to normal.