472,110 Members | 2,079 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,110 software developers and data experts.

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 5720
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 leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.