Your problems with cut & paste are not the author's fault. Everything I copy from a code block gets smooshed into one long line, even Jeff Moden's beautiful...
While I do appreciate the effort that went into the article, I have to agree that it would have been better if it had been edited and the SQL checked...