EASY: SQL to generate a simple random number? 
Author Message
 EASY: SQL to generate a simple random number?

Quite simply, is there an SQL command to generate a unique
random number (one that isn't already present in a particular
field)?  Another way to say it would be, can an SQL command
look into a field and find a number that hasn't appeared yet
(the field is already set up to not allow duplicates) and
return it.

Please respond via email:

Jeff Somerville



Sat, 01 Apr 2000 03:00:00 GMT
 EASY: SQL to generate a simple random number?

If it doesn't need to be random, but just unique try creating the table and
 declare that column as an identity column.

Quote:

>Quite simply, is there an SQL command to generate a unique
>random number (one that isn't already present in a particular
>field)?  Another way to say it would be, can an SQL command
>look into a field and find a number that hasn't appeared yet
>(the field is already set up to not allow duplicates) and
>return it.

>Please respond via email:

>Jeff Somerville




Sun, 02 Apr 2000 03:00:00 GMT
 EASY: SQL to generate a simple random number?


Quote:

>If it doesn't need to be random, but just unique try creating the table and
> declare that column as an identity column.

Identity are ice. And if the purpose is only uniqueness, just try a
timestamp.


Mon, 03 Apr 2000 03:00:00 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Generating Random Numbers in SQL Server 6.5 Stored Procedure

2. PL/SQL Generating a random number

3. SQL to Generate Random Numbers?

4. generating a random number

5. How to generate random numbers!

6. Generating Random Numbers

7. generating a random number with duplicate records

8. Generating Random Numbers

9. Generating random numbers mixed with strings

10. How to generate a difficult random number.

11. need help - generating random numbers

12. generating random numbers


 
Powered by phpBB® Forum Software