krombit,
I have seen this error. I get this error when I run the script in a database where the compatibility level is set to something other than SQL Server 2005. So check the compatibility level of the db you are running the query in or run the query in tempdb.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question