COUNT DISTINCT not supported in a windowing context (not documented)

As a trivial example, consider the following dataset:

CountDistinctSalesDataset

Suppose we need to determine the number of customers associated to employee, and we need this result for each row in a report in we are generating.  (The report computes other columns of interest, such as a running total, that we will ignore in this post.)

We could write this as follows:

select	EmployeeName,
	count(CustomerName) over (partition by EmployeeName) CustomerCount
from	Sales;

This works fine for Bob, but for Alice it incorrectly returns a value of 3.  This, of course, happens because Alice is associated with Eve on two different sales.

CountDistinctIncorrectResult

It seems simple and logical to add the distinct keyword:

select	EmployeeName,
	count(distinct CustomerName) over (partition by EmployeeName) CustomerCount
from	Sales;

The first time that I tried this was on a SQL Server 2008 system running at SP2, and it generated the following error:

Msg 102, Level 15, State 1, Line 2
Incorrect syntax near 'distinct'.

On a SQL Server 2008 system at SP3, the following improved error is generated instead:

Msg 10759, Level 15, State 1, Line 2
Use of DISTINCT is not allowed with the OVER clause.

The same error happens with SQL Server 2008 R2 (SP1) and with SQL Server 2012 (RTM).

As the second error message makes clear, this particular usage is not supported.  This is fine and well, except that this limitation doesn’t seem to documented in Books Online, at least not under the COUNT or OVER topics for these three versions of SQL Server.