Luis Cazares (5/11/2014)
Your query looks just like mine but using a while loop instead of a single operation. Why would you do that.
Because and like he said, he's a C# procedural programmer just making his first move from a procedural language to a declarative language and hasn't yet made the necessary paradigm shift. 🙂 Based on how he formatted the code and the fact that he understands the use of NEWID() in conjuction with modulus to produce a constrained random integer, he'll get it. It's just going to take some time like the first time most of us started working with T-SQL.
--Jeff Moden
Change is inevitable... Change for the better is not.