469,623 Members | 1,127 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,623 developers. It's quick & easy.

auto generate Number

G
Hello Firends

I want a sample code for developing an " auto genearte number " and want to
store in database.

Please if you find any code please send

Thanks in Advance
G
Dec 8 '06 #1
2 5632
Hi G

This would probably better posted to another group. however I have
found that it is better to allow the database to generate the the
number for you. If using access then try AUTONUMBER, if using oracle
then use a sequence to generate the number Not 100% sure about SQL but
I believe you can us @@Identity.

Reagrds
Tony

G wrote:
Hello Firends

I want a sample code for developing an " auto genearte number " and want to
store in database.

Please if you find any code please send

Thanks in Advance
G
Dec 9 '06 #2
SQL Server has an auto-increment field. @@Identity gets the value of the
identity column of the most recently added record using the same connection.

--
Mike Brind

<an***********@googlemail.comwrote in message
news:11**********************@n67g2000cwd.googlegr oups.com...
Hi G

This would probably better posted to another group. however I have
found that it is better to allow the database to generate the the
number for you. If using access then try AUTONUMBER, if using oracle
then use a sequence to generate the number Not 100% sure about SQL but
I believe you can us @@Identity.

Reagrds
Tony

G wrote:
>Hello Firends

I want a sample code for developing an " auto genearte number " and want
to
store in database.

Please if you find any code please send

Thanks in Advance
G

Dec 9 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Laphan | last post: by
5 posts views Thread by Geoff Cayzer | last post: by
6 posts views Thread by Sebastien | last post: by
2 posts views Thread by SalimShahzad | last post: by
4 posts views Thread by Shahar | last post: by
13 posts views Thread by S.Dickson | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.