For Programmers: Free Programming Magazines  


Home > Archive > ASP > December 2006 > auto generate Number









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author auto generate Number
G

2006-12-11, 6:57 pm

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


anthonybrough@googlemail.com

2006-12-11, 6:57 pm

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


Mike Brind

2006-12-11, 6:57 pm

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

<anthonybrough@googlemail.com> wrote in message
news:1165701100.541225.214210@n67g2000cwd.googlegroups.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:
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com