Search This Blog

Unable to retrieve list of databases. Reason: Failed to connect to the server. Reason: The 'SQLNCLI11' provider is not registered on the local machine.

Unable to retrieve list of databases. Reason: Failed to connect to the server. Reason: The 'SQLNCLI11' provider is not registered on the local machine.

Issue: while working on a Power Pivot Report we opened a power pivot report in Client Machine to as we need to change the Database Name of the Report.

Issue Description: After opening the Power Pivot window when we tried to connect to DB Server we got the below Error.



 Like in Screenshot the error indicates that SQLNClLI11 is not registered in your local machine.
You can also got an error if you are using sql 2008 then the Error will be SQLNCLI10 is not Registered on your local machine like below.



So below are link you can download the SQSQL Nativelient 10 and 11.

Download Native clin10 for SQL 2008 from below Link into your client System.

Download Native client11 for SQL 2012 from below link to Client System

Once you will download the appropriate Native clients as per your System i.e 32 or 64 bit you will be able to connect to DB Successfully.
In case after Installing the native client also you were still getting the Same Issues.

Then the  Best solution is 

Go to Advanced Section in the PowerPivot Data connection Window.
Providers- Change the Provider from 10.0 or 11.0 to Microsoft Ole Db provider for SQL Server
Test Connection
Ok


Now you will notice that you are able to connect to your database without installing Native clients also.



Sorting Months Name by calendar Order in Powerpivot Slicer

Sorting Months Name by calendar Order in Powerpivot Slicer

 When we add a column containing Month Name in Powerpivot Slicer fields it sort the data alphabetically like first (April, August, etc.) but we need the Month Name to be sorted Naturally
Like January, February, March….

There is no direct way to sort this you need to do workaround for slicers.

I am giving Example where I was using month Names from SQL query.
Sample Query that will fetch All MonthNames from Master database view spt_Values.

SELECT number, DATENAME(MONTH, '2014-' + CAST(number as varchar(2)) + '-1') monthname
FROM master..spt_values
WHERE Type = 'P' and number between 1 and 12
ORDER BY Number

We will insert this record in a temp table so that we can write a query to temp table
SELECT number, DATENAME(MONTH, '2014-' + CAST(number as varchar(2)) + '-1') monthname
 into #temp from  master.dbo.spt_values
WHERE Type = 'P' and number between 1 and 12
ORDER BY Number

Select * from #temp
Output
number            monthname
1          January
2          February
3          March
4          April
5          May
6          June
7          July
8          August
9          September
10         October
11         November
12         December

So if you will create a Slicer based on this Data you can produce the Issue you will have slicer sorted in alphabetical order like below.
Issue Screenshot



Solution: In order to sort in Natural Order you need to add a Prefix before your month name this is the only workaround that you can do with Slicer.

Note: Don't forget to add zero before 1,2….9 otherwise it will not sort your slicer as required.

So here is the SQL code to add prefix.
select case [MonthName] when 'January' then '01January'
when 'February' then '02February'

 when 'March' then '03March'
when 'April' then '04April'
when 'May' then '05May'
when 'June' then  '06June'
when 'July' then  '07July'
when 'August' then '08August'
when 'September' then '09September'
when 'October' then '10October'
when 'November' then '11November'
when 'December' then  '12December'
end [MonthName]
from #temp


Refresh your Report having MonthName Slicer and Sort from A to Z.The Slicer will get sorted in a Natural Sort from January to December as below.



Note : If you don't want to change anything in your sql code you can achieve the same result by following msdn blog-http://blogs.msdn.com/b/analysisservices/archive/2010/04/21/sorting-month-by-natural-sort-order.aspx