Hi Guy's,
How do I insert generated values as a set and using not using a loop or cursor?
THere was a work around in 2000 but I've been out of the loop for a while and now I'm catching up on 2005 and can't seem to get it working.
Let me illustrate.
I select a name from a table and insert it into a new table with a randomly generated number. For simplicities sake let's just assume
Insert NewTable (Name, Random)
Select Name, Rand() from NameTable
The result would be.
John 0.212
Jane 0.212
Wayne 0.212
NOw how do I go about generating Rand() per row rather than per table?
Cheers!
How do I insert generated values as a set and using not using a loop or cursor?
THere was a work around in 2000 but I've been out of the loop for a while and now I'm catching up on 2005 and can't seem to get it working.
Let me illustrate.
I select a name from a table and insert it into a new table with a randomly generated number. For simplicities sake let's just assume
Insert NewTable (Name, Random)
Select Name, Rand() from NameTable
The result would be.
John 0.212
Jane 0.212
Wayne 0.212
NOw how do I go about generating Rand() per row rather than per table?
Cheers!