i just tested it in 2008R2, 2005, and compatibility 80.
the database you are testing in is set for compatibility 80 instead of 90.
in SQL2000 (80), functions were not allowed, and that's why you get the syntax error;
change your database compatibility.
EXEC dbo.sp_dbcmptlevel @dbname=N'SANDBOX', @new_cmptlevel=90
try it in tempdb if you want, and it works fine, since tempdb will be the version of the server.
Lowell