An ORDER BY clause can be used explicitly in the end as well. In that case the COUNT is not deterministic. See Deterministic and Nondeterministic Functions for more.
but the page you referenced has
For example, specifying an ORDER BY clause in a query does not change the determinism of a function that used in that query.
Just wondering about your description of deterministic, it doesn't seem to make sense.
another snippet from the web page might shed some light on this:
Functions that call extended stored procedures are nondeterministic, because the extended stored procedures can cause side effects on the database.
I think a simple (maybe naïve) definition of "deterministic" could be that given the same input, the function will return the same output, but your writeup doesn't even match this. Heck strictly speaking, count(<whatever>
isn't even behaving as a function and I wouldn't even call it one. Maybe call it an aggregate or something catchy like that.
to properly post on a forum:http://www.sqlservercentral.com/articles/61537/