|
 |
asp_databases thread: generating and storing random numbers
Message #1 by arshad siddiqui <ash_arshad@y...> on Mon, 29 Jul 2002 06:31:42 -0700 (PDT)
|
|
Hi,
Is it possible to generate a unique random number and
store it in database.but the condition is that no
repetition of numbers should be there because I wanna
store unique random number in the database.
To make it more clear I have a form in which there is
a text box for Client No along with other form
elements.If I dont enter anything into the text box
for Client No and submit the form , a unique random no
should be generated and entered into the database.
Any body having any idea about this please let me know
Thanks
Best Regards
--Arshad--
__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com
Message #2 by "Jonathan Charlton" <jcharlton@e...> on Mon, 29 Jul 2002 14:36:36 +0100
|
|
Why not order all of the Clients in descending order then grab the top one
and add 1 to it. This way you know that it is not being used!
-----Original Message-----
From: arshad siddiqui [mailto:ash_arshad@y...]
Sent: 29 July 2002 14:32
To: ASP Databases
Subject: [asp_databases] generating and storing random numbers
Hi,
Is it possible to generate a unique random number and
store it in database.but the condition is that no
repetition of numbers should be there because I wanna
store unique random number in the database.
To make it more clear I have a form in which there is
a text box for Client No along with other form
elements.If I dont enter anything into the text box
for Client No and submit the form , a unique random no
should be generated and entered into the database.
Any body having any idea about this please let me know
Thanks
Best Regards
--Arshad--
__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com
Message #3 by Colin.Montgomery@C... on Mon, 29 Jul 2002 14:37:31 +0100
|
|
I know you sent this before, and will be looking for a different answer, but
why does it have to be a RANDOM number? Why not just a unique no? I.e. In
Access use datatype Autonumber, and in SQL Server use Int with Auto
Increment.
If you use this solution the DB takes care of everything for you. Unless
you don't want your first customer to have a customer ID of 000001, your
second customer 000002 etc, then surely this method will work?
HTH,
Col
-----Original Message-----
From: arshad siddiqui [mailto:ash_arshad@y...]
Sent: 29 July 2002 14:32
To: ASP Databases
Subject: [asp_databases] generating and storing random numbers
Hi,
Is it possible to generate a unique random number and
store it in database.but the condition is that no
repetition of numbers should be there because I wanna
store unique random number in the database.
To make it more clear I have a form in which there is
a text box for Client No along with other form
elements.If I dont enter anything into the text box
for Client No and submit the form , a unique random no
should be generated and entered into the database.
Any body having any idea about this please let me know
Thanks
Best Regards
--Arshad--
__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com
*******
This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the
intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are
not the intended recipient you must not copy this message or attachment or disclose the contents to any other person.
For further information about Clifford Chance please see our website at http://www.cliffordchance.com or refer to any Clifford
Chance office.
Message #4 by arshad siddiqui <ash_arshad@y...> on Tue, 30 Jul 2002 07:02:09 -0700 (PDT)
|
|
Hi,
Thanks for your help.
Suppose I give it autonumber then is it possible to
enter a client Number of my choice and then next
client number start by incrementing it and so on.
Thanks
Regards
--Arshad--
--- Colin.Montgomery@C... wrote:
> I know you sent this before, and will be looking for
> a different answer, but
> why does it have to be a RANDOM number? Why not
> just a unique no? I.e. In
> Access use datatype Autonumber, and in SQL Server
> use Int with Auto
> Increment.
>
> If you use this solution the DB takes care of
> everything for you. Unless
> you don't want your first customer to have a
> customer ID of 000001, your
> second customer 000002 etc, then surely this method
> will work?
>
> HTH,
> Col
>
> -----Original Message-----
> From: arshad siddiqui [mailto:ash_arshad@y...]
> Sent: 29 July 2002 14:32
> To: ASP Databases
> Subject: [asp_databases] generating and storing
> random numbers
>
>
> Hi,
> Is it possible to generate a unique random number
> and
> store it in database.but the condition is that no
> repetition of numbers should be there because I
> wanna
> store unique random number in the database.
> To make it more clear I have a form in which there
> is
> a text box for Client No along with other form
> elements.If I dont enter anything into the text box
> for Client No and submit the form , a unique random
> no
> should be generated and entered into the database.
>
> Any body having any idea about this please let me
> know
>
> Thanks
> Best Regards
> --Arshad--
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Health - Feel better, live better
> http://health.yahoo.com
>
>
>
> *******
>
> This message and any attachment are confidential and
> may be privileged or otherwise protected from
> disclosure. If you are not the intended recipient,
> please telephone or email the sender and delete this
> message and any attachment from your system. If you
> are not the intended recipient you must not copy
> this message or attachment or disclose the contents
> to any other person.
>
> For further information about Clifford Chance please
> see our website at http://www.cliffordchance.com or
> refer to any Clifford Chance office.
>
>
__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com
Message #5 by "Roy, Siddarth S" <sroy@b...> on Tue, 30 Jul 2002 10:06:29 -0400
|
|
U can do this by a database sequence
create sequence starting number of 10 increment by whatever number u
want
Hoep this helps
thx
sid
-----Original Message-----
From: arshad siddiqui [mailto:ash_arshad@y...]
Sent: Tuesday, July 30, 2002 10:02 AM
To: ASP Databases
Subject: [asp_databases] RE: generating and storing random numbers
Hi,
Thanks for your help.
Suppose I give it autonumber then is it possible to
enter a client Number of my choice and then next
client number start by incrementing it and so on.
Thanks
Regards
--Arshad--
--- Colin.Montgomery@C... wrote:
> I know you sent this before, and will be looking for
> a different answer, but
> why does it have to be a RANDOM number? Why not
> just a unique no? I.e. In
> Access use datatype Autonumber, and in SQL Server
> use Int with Auto
> Increment.
>
> If you use this solution the DB takes care of
> everything for you. Unless
> you don't want your first customer to have a
> customer ID of 000001, your
> second customer 000002 etc, then surely this method
> will work?
>
> HTH,
> Col
>
> -----Original Message-----
> From: arshad siddiqui [mailto:ash_arshad@y...]
> Sent: 29 July 2002 14:32
> To: ASP Databases
> Subject: [asp_databases] generating and storing
> random numbers
>
>
> Hi,
> Is it possible to generate a unique random number
> and
> store it in database.but the condition is that no
> repetition of numbers should be there because I
> wanna
> store unique random number in the database.
> To make it more clear I have a form in which there
> is
> a text box for Client No along with other form
> elements.If I dont enter anything into the text box
> for Client No and submit the form , a unique random
> no
> should be generated and entered into the database.
>
> Any body having any idea about this please let me
> know
>
> Thanks
> Best Regards
> --Arshad--
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Health - Feel better, live better
> http://health.yahoo.com
>
>
>
> *******
>
> This message and any attachment are confidential and
> may be privileged or otherwise protected from
> disclosure. If you are not the intended recipient,
> please telephone or email the sender and delete this
> message and any attachment from your system. If you
> are not the intended recipient you must not copy
> this message or attachment or disclose the contents
> to any other person.
>
> For further information about Clifford Chance please
> see our website at http://www.cliffordchance.com or
> refer to any Clifford Chance office.
>
>
__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com
|
|
 |