Help: SQL Server

Sharing my knowlege about SQL Server Troubleshooting Skills

  • Blog Stats

    • 1,882,458 hits
  • Select GETDATE()

    May 2021
    M T W T F S S

Archive for the ‘Error’ Category

Solution : SQL Server Configuration Manager – Cannot connect to WMI provider – Provider load failure [0x80041013]

Posted by blakhani on February 3, 2015

One of my friend had something wrong with SQL Server installation. He did multiple things like repair, registry cleanup etc. I helped him in cleaning up stuff and reinstalling SQL Server. Things were looking good but there was one pending issue.

As soon as he was trying to launch SQL Server Configuration Manager, he was seeing below error.

SQL Server Configuration Manager
Cannot connect to WMI provider. You do not have permission or the server is unreachable. Note that you can only manage SQL Server 2005 and later servers with SQL Server Configuration Manager.
Provider load failure [0x80041013]


Another variation of same error is The specified module could not be found. [0x8007007e] – This clearly indicates that some dll is not registered.

He found this KB but he was on SQL 2008 SP3 so this was not applicable. Since there was many things done by him, I was almost sure that this is due to either missing DLL or some WMI provider related files. Below were the steps performed to fix the issue.

  • We need to make sure that we have sqlmgmproviderxpsp2up.mof file present and complied. Refer my earlier blog for using mofcomp to compile the mof files.
  • Make sure we have sqlmgmprovider.dll file in “shared” folder. The location of folder would be dependent on SQL version. On my machine it is located under “C:\Program Files\Microsoft SQL Server\100\Shared” The folder 100 is for SQL 2008. Refer below table for version and name mapping.  

Microsoft SQL Server 2014


Microsoft SQL Server 2012


Microsoft SQL Server 2008 R2


Microsoft SQL Server 2008


Microsoft SQL Server 2005


  • If file is present in the folder, please register the DLL using command (regsvr32.exe "C:\Program Files\Microsoft SQL Server\110\Shared\sqlmgmprovider.dll")
  • Make sure we have file “svrenumapi.dll” in the same folder. If file exists, register it using regsrv32.exe as pointed earlier. In SQL 2014 the file is called as svrenumapi12.dll
  • Make sure that file framedyn.dll exists in “C:\WINDOWS\system32” folder. If not, pick it from C:\WINDOWS\system32\wbem folder and keep it to system32.
  • Check your environment variables. the PATH variable has C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem

If none of the above is working then you should download Process Monitor and capture data while launching SQL Server Configuration Manager. Look for “Name not found” and that might give you some hint. Comment below if you found any other solution

Posted in Error, SQL Server | Tagged: , , , , , | 3 Comments »

Error : Your SQL Server installation is either corrupt or has been tampered with (Error getting instance ID from name.). Please uninstall then re-run setup to correct this problem

Posted by blakhani on December 16, 2014

While working for my next blog I made some stupid changes and wanted to start SQL from command line. I have been using net start command to start SQL Services from command line but today I ran the executable directly. The advantage of this method is that information which goes to ERRORLOG is also shown on command line. I browsed to Binn folder and typed executable name sqlservr.exe and hit enter. I was welcomed with Error message as below.

E:\Program Files\Microsoft SQL Server\MSSQL12.SQL2014\MSSQL\Binn>sqlservr.exe
2014-12-16 05:14:43.93 Server      Multiple instances of SQL server are installed on this computer. Renter the command, specifying the -s parameter with the name of the instance that you want to start.

Since my machine has multiple instances, the error message was quite clear so I added –s SQL2012 and hit enter. and this time, I got more dangerous error message

SQL Server
Your SQL Server installation is either corrupt or has been tampered with (Error getting instance ID from name.).   Please uninstall then re-run setup to correct this problem


Well, error message as interesting information “Error getting instance ID from name” I went ahead and looked at instance name and it was SQL2014. Once I gave sqlservr.exe –sSQL2014 on command prompt, life was good and SQL Server got started.

If you get similar error, First make sure that instance name is correct. To know the instance name, refer my earlier blog What’s my SQL Server Name?

Hope this helps.

  • Cheers,
  • Balmukund Lakhani
  • Twitter @blakhani
  • Facebook blakhani
  • Posted in Error, SQL Server | Tagged: , | 1 Comment »

    Explanation : Error: 5125, Severity: 24, State: 2

    Posted by blakhani on December 4, 2014

    While playing with log shipping and backup restore, one of my database gone bad and was not coming online. I checked ERRORLOG and found below messages.

    2014-11-20 22:16:59.37 spid51s     Error: 5125, Severity: 24, State: 2.
    2014-11-20 22:16:59.37 spid51s     File ‘C:\SQLServerData\MyTestLogShippping.ndf’ appears to have been truncated by the operating system.  Expected size is 19325 KB but actual size is 0 KB.


    The error message is pretty clear and takes away blame from SQL Server. I checked the size of MyTestLogShippping.ndf and it was indeed zero KB. In my case, I was copying the file over the network and something might have gone wrong during that. It is clear that SQL Server checked for “expected” size and “actual” size during recovery of database and if there is a mismatch, above error is logged.

    What can be done to fix the issue? Well, restore from backup is option to get out from this situation. Or, if you can get back the original copy of the problematic file (which is close to impossible) then use that for recovery.

    If its frequent on your environment then you may need to check if you have some third party tool which is doing disk defragmentation.

    hope this helps.

  • Cheers,
  • Balmukund Lakhani
  • Twitter @blakhani
  • Posted in Error, SQL Server | Tagged: , , | 1 Comment »