Home » SQL & PL/SQL » SQL & PL/SQL » Autogenerate number?
icon5.gif  Autogenerate number? [message #222616] Mon, 05 March 2007 12:24 Go to next message
balaji23_d
Messages: 123
Registered: February 2007
Senior Member
There is autonumber datatype (option etc) available in sql server ?
I want one field which datatype autonumber, it
will automatically insert number when data insert on each record.
1, 2 , 3, 4,.... and so on
just like in ACCESS database there is autonumber datatype in sql server ?
Re: Autogenerate number? [message #222618 is a reply to message #222616] Mon, 05 March 2007 12:25 Go to previous messageGo to next message
BlackSwan
Messages: 25050
Registered: January 2009
Location: SoCal
Senior Member
It is called SEQUENCE in Oracle
Re: Autogenerate number? [message #222625 is a reply to message #222616] Mon, 05 March 2007 12:43 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
balaji23_d wrote on Mon, 05 March 2007 19:24
There is autonumber datatype (option etc) available in sql server ?
I want one field which datatype autonumber, it
will automatically insert number when data insert on each record.
1, 2 , 3, 4,.... and so on
just like in ACCESS database there is autonumber datatype in sql server ?


Are you aware that this is an Oracle site? Your other question mentioned Datediff(), also a non-Oracle function...
Re: Autogenerate number? [message #222642 is a reply to message #222616] Mon, 05 March 2007 14:39 Go to previous messageGo to next message
Bill B
Messages: 1484
Registered: December 2004
Senior Member
you would need a combination of a sequence and a trigger to emulate the microsoft autonumber field. See the following link.

http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:924629350003
Re: Autogenerate number? [message #222686 is a reply to message #222642] Mon, 05 March 2007 23:00 Go to previous message
balaji23_d
Messages: 123
Registered: February 2007
Senior Member
thank you guys.. I understood now...
Previous Topic: characters and numeric count in a String
Next Topic: Decimal place problem...Round Function
Goto Forum:
  


Current Time: Sat Dec 10 14:39:55 CST 2016

Total time taken to generate the page: 0.11021 seconds