Do you know that FOREACH is not part of SQL? That // is not part of SQL?
How do you expect anyone to answer this question with the code and data you gave us?
Rudeness and ignorance are a bad way to get help on a forum. Want to try again, with Netiquette and information?
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL
Microsoft is conducting an online survey to understand your opinion of the Technet Web site. If you choose to participate, the online survey will be presented to you when you leave the Technet Web site.