Link to home
Start Free TrialLog in
Avatar of SahdevSingh
SahdevSingh

asked on

auto number generation

hi there
 i am very new in sql database, actually i am trying to define one of my field as an  autonumber datatype and yes/no datatype, like which is available in ms access where we define our field as autonumber, n whenever a new records insert into database it will automatically incremented. and in yes/no field there is a sort of checkbox comes in the that field which returns boolean values..

Plz Hellp

ASKER CERTIFIED SOLUTION
Avatar of stiemark
stiemark

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of annine
annine

You can use "int" data type and set Identity = Yes, Identity Seed = 1, and Identity Increment = 1 for your field that you want to use as Autonumber in Access.

And you can use "bit" data type for your field that you want to use as Yes/No in Access.

Do I help you?
Why use a 'long' for the data type?  Most of the time an 'int' would be far more effective.  But, yes, setting it to an 'identity' type (in the table designer, down towards the bottom there is a field that allows you to do this) achieves the same effect as an 'Autonumber'.

A 'bit' data type is the equivalent of a 'yes/no' field.  Set it to 0 for 'No' and 1 for 'Yes'.  Depending on your application (ie asp, vb...) you may need to check this field for 1 or 0 rather than 'true' or 'false'.
Avatar of SahdevSingh

ASKER

thankx to all of u
SahdevSingh:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
No comment has been added to this question in more than 257 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
   Accept: stiemark http:#8109456

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

monosodiumg
EE Cleanup Volunteer