Hey all...
I don't know how it happened, but the code in the article is missing some spaces from what I submitted. They should be pretty obvious where that is, but if you are having problems let me know and I'll post how it should be (or get Steve or someone to add them to the article).
The biggest offenders:
space needed between "use" and "AdventureWorks"
space needed between "set" / "select" / "declare" / "print" / "if" and the rest of the command.
space needed between "FOR" and "XML"
space needed between "XML" and "PATH"
Wayne
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes