auto generate Number

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • G

    auto generate Number

    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

    #2
    Re: auto generate Number

    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

    Comment

    • Mike Brind

      #3
      Re: auto generate Number

      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.comw rote in message
      news:1165701100 .541225.214210@ n67g2000cwd.goo glegroups.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
      >

      Comment

      Working...