This query returns "ID" with a lot of spaces at the end. Since we are using it with ASP.NET MVC to populate SelectListItem (which declares "Value" as string type) this is a problem for us.

Suggested solution:

I downloaded 3.2GA sources and added one line of code:
Modified file: src\NHibernate\Dialect\MsSql2000Dialect.cs
Modified method: RegisterFunctions()
Modification: line added: RegisterFunction("str", new SQLFunctionTemplate(NHibernateUtil.String, "cast(?1 as nvarchar)"));