the procedure of mystery man produces random numbers but they can
appear more than once which should not happen. So it would be
necessary to create a new number, check if it exists, if not use it,
else create a new random number, ... can become a timeconsuming
problem if you try this with numbers between 1 and 999 and you have
more than 999 records in your database :-))
If you only need it to do a random read, try this:
select * from myTable order by newid()
this will show you the records every time in another order.
hth,
Helmut
"Mystery Man" <Pr************ @hotmail.com> schrieb im Newsbeitrag
news:87******** *************** *@posting.googl e.com...
Have a look at the Rand function.
Here is a possible example
declare @counter int
SET @counter = 1
WHILE @counter < 1000
begin
print convert(int,sub string(convert( varchar(8), RAND(@counter)) ,6,3))
SET @counter = @counter + 1
end