Link to home
Start Free TrialLog in
Avatar of ubya308
ubya308

asked on

Setting a column's datatype to autonumber

I have noticed that in Access RDBMS you are able to set the data-type of a column to autonumber which then automatically assigns a unique identifying number to each row. Is there an equivalent SQL command for a database such as mySQL?
ASKER CERTIFIED SOLUTION
Avatar of rickbus101
rickbus101

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 Guy Hengel [angelIII / a3]
If you want other UniqueIdentifier as datatype (that 128 byte long GUID), you may assign the Default value of the column to NEWID()

create table tablename
 (fieldname uniqueidentifier DEFAULT NEWID())